Fix QPropertyAlias::addNotifier
QPropertyAlias might be deprecated, but using it should still not fail to compile. Pick-to: 6.5 Fixes: QTBUG-111735 Change-Id: I486cddb424b60cd3e5c539e26afca3726e29bb09 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
parent
bbb9cf225f
commit
17c9001a53
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user