diff options
-rw-r--r-- | src/corelib/kernel/qproperty.h | 2 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index dd18d95c50..e45d532fb9 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -999,7 +999,7 @@ public: template<typename Functor> QPropertyNotifier addNotifier(Functor f) { - return QBindable<T>(aliasedProperty(), iface).notify(f); + return QBindable<T>(aliasedProperty(), iface).addNotifier(f); } bool isValid() const diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp index 8e9192c27e..0694ccde00 100644 --- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp +++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp @@ -2296,7 +2296,10 @@ void tst_QProperty::qpropertyAlias() alias.setValue(42); QCOMPARE(i->value(), 42); QProperty<int> j; + bool notifierCalled = false; + auto myNotifier = alias.addNotifier([&](){notifierCalled = true;}); i->setBinding([&]() -> int { return j; }); + QVERIFY(notifierCalled); j.setValue(42); QCOMPARE(alias.value(), 42); i.reset(); |