summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r--tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
index d4c5741814..cc04c2f1b5 100644
--- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
+++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
@@ -67,6 +67,7 @@ private slots:
void settingPropertyValueDoesRemoveBinding();
void genericPropertyBinding();
void genericPropertyBindingBool();
+ void staticChangeHandler();
};
void tst_QProperty::functorBinding()
@@ -658,6 +659,25 @@ void tst_QProperty::genericPropertyBindingBool()
QVERIFY(property.value());
}
+struct ItemType
+{
+ QProperty<int> x;
+ QVector<int> 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<int> values{42, 100};
+ QCOMPARE(t.observedValues, values);
+}
+
QTEST_MAIN(tst_QProperty);
#include "tst_qproperty.moc"