diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 297a3fe9740..be960552fd6 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -982,7 +982,7 @@ public: template QPropertyNotifier addNotifier(Functor f) { - return QBindable(aliasedProperty(), iface).notify(f); + return QBindable(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 29a55e58ae0..9e9aa981aaa 100644 --- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp +++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp @@ -2290,7 +2290,10 @@ void tst_QProperty::qpropertyAlias() alias.setValue(42); QCOMPARE(i->value(), 42); QProperty 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();