summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qproperty.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-05-25 12:51:39 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-05-27 11:54:30 +0200
commit524d78160726b25ed424a2c7a6d5e423b7ea4b93 (patch)
treec5ca373ef8231454dab4a73ffe2d479a73f103aa /src/corelib/kernel/qproperty.h
parent36bd34dbdcaa0fcfd47d1edb3494a4babb709ca3 (diff)
QProperty: Support multiple observers
Previously, only the first observer would get notified. Also, make sure that the notifiers are always retained when switching between bindings and values. Change-Id: I9c25c0f2e288dac3a335b68e618f7ddeb44be25a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r--src/corelib/kernel/qproperty.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h
index 22313bc92e..938de61fd5 100644
--- a/src/corelib/kernel/qproperty.h
+++ b/src/corelib/kernel/qproperty.h
@@ -254,16 +254,16 @@ public:
void setValue(T &&newValue)
{
+ d.priv.removeBinding();
if (d.setValueAndReturnTrueIfChanged(std::move(newValue)))
notify();
- d.priv.removeBinding();
}
void setValue(const T &newValue)
{
+ d.priv.removeBinding();
if (d.setValueAndReturnTrueIfChanged(newValue))
notify();
- d.priv.removeBinding();
}
QProperty<T> &operator=(T &&newValue)