From b20c7df63aec36cb3cb871e4b898b0e684dcb59a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 30 Apr 2020 08:34:42 +0200 Subject: Remove QPropertyMemberChangeHandler again Adding support for a static notifier within QProperty itself - through a QProperty "sister" class - is more efficient in terms of memory consumption and run-time performance. The MemberChangeHandler permanently takes up at least three pointers, while the notified properties only cost one pointer in the binding. Change-Id: Ia1a8c2b66f1f3c2fe13ae0ad9f12cdb6bdcc35ef Reviewed-by: Ulf Hermann --- .../auto/corelib/kernel/qproperty/tst_qproperty.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp index 53d361ca26..cafc193257 100644 --- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp +++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp @@ -67,7 +67,6 @@ private slots: void settingPropertyValueDoesRemoveBinding(); void genericPropertyBinding(); void genericPropertyBindingBool(); - void staticChangeHandler(); void setBindingFunctor(); void multipleObservers(); void propertyAlias(); @@ -661,25 +660,6 @@ void tst_QProperty::genericPropertyBindingBool() QVERIFY(property.value()); } -struct ItemType -{ - QProperty x; - QVector observedValues; - void xChanged() { - observedValues << x.value(); - } - QPropertyMemberChangeHandler<&ItemType::x, &ItemType::xChanged> test{this}; -}; - -void tst_QProperty::staticChangeHandler() -{ - ItemType t; - t.x = 42; - t.x = 100; - QVector values{42, 100}; - QCOMPARE(t.observedValues, values); -} - void tst_QProperty::setBindingFunctor() { QProperty property; -- cgit v1.2.3