forked from quickshell/quickshell
all: use BINDABLE only with trivial setters
Fixes various bugs caused by the QML engine bypassing setters when BINDABLE is specified (even if the bindable is const). Also restructures all properties using BINDABLE to have a default READ and WRITE to ensure this doesn't happen again.
This commit is contained in:
parent
2e3c15f7a1
commit
b67f92bc13
10 changed files with 167 additions and 180 deletions
|
@ -282,15 +282,6 @@ bool setSimpleObjectHandle(auto* parent, auto* value) {
|
|||
return SimpleObjectHandleOps<member, destroyedSlot, changedSignal>::setObject(parent, value);
|
||||
}
|
||||
|
||||
// NOLINTBEGIN
|
||||
#define QS_TRIVIAL_GETTER(Type, member, getter) \
|
||||
[[nodiscard]] Type getter() { return this->member; }
|
||||
|
||||
#define QS_BINDABLE_GETTER(Type, member, getter, bindable) \
|
||||
[[nodiscard]] Type getter() { return this->member.value(); } \
|
||||
[[nodiscard]] QBindable<Type> bindable() { return &this->member; }
|
||||
// NOLINTEND
|
||||
|
||||
template <auto methodPtr>
|
||||
class MethodFunctor {
|
||||
using PtrMeta = MemberPointerTraits<decltype(methodPtr)>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue