Add method to conditionally remove binding to QObjectCompatProperty
Setters of QObjectCompatProperty need to remove the binding, but only if it is not in the wrapper. This patch adds this method to the public interface. Change-Id: Ibc96418fe15b0aeeb2059411ea910ba1f733c255 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
74f549b402
commit
52fcd0b6d7
@ -504,6 +504,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void removeBindingUnlessInWrapper()
|
||||
{
|
||||
QBindingStorage *storage = qGetBindingStorage(owner());
|
||||
auto *bd = storage->bindingData(this);
|
||||
// make sure we don't remove the binding if called from the bindingWrapper
|
||||
const bool inWrapper = inBindingWrapper(storage);
|
||||
if (bd && !inWrapper)
|
||||
bd->removeBinding();
|
||||
}
|
||||
|
||||
QPropertyBinding<T> binding() const
|
||||
{
|
||||
auto *bd = qGetBindingStorage(owner())->bindingData(this);
|
||||
|
Loading…
Reference in New Issue
Block a user