Fix QPropertyAlias::addNotifier
QPropertyAlias might be deprecated, but using it should still not fail to compile. Fixes: QTBUG-111735 Change-Id: I486cddb424b60cd3e5c539e26afca3726e29bb09 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 17c9001a53a2377cc38bdf4b1982cab2dca94573) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1ac4375135
commit
b8a702a8f7
@ -982,7 +982,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
|
||||
|
@ -2290,7 +2290,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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user