summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorTomasz Olszak <olszak.tomasz@gmail.com>2014-01-08 17:12:28 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-09 12:14:42 +0100
commit3867bc5a10f0b798154025265efacd2f53ace06e (patch)
tree539395ea5e699f070b9870ec83a11e44f20d9bf6 /tests/auto
parentb28764c641e4fef19d5e800b7537439fb2054914 (diff)
Send DynamicPropertyChange event only when value is changed.
According to docs DynamicPropertyChange event should be sent from setProperty function only when property is added, removed or changed. Change-Id: I080a27a4119a63580b03172f4b5b367338c6f440 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index a5b5b659ea..8875998433 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -2950,6 +2950,9 @@ void tst_QObject::dynamicProperties()
QVERIFY(!obj.setProperty("myuserproperty", "Hello"));
QCOMPARE(obj.changedDynamicProperties.count(), 1);
QCOMPARE(obj.changedDynamicProperties.first(), QByteArray("myuserproperty"));
+ //check if there is no redundant DynamicPropertyChange events
+ QVERIFY(!obj.setProperty("myuserproperty", "Hello"));
+ QCOMPARE(obj.changedDynamicProperties.count(), 1);
obj.changedDynamicProperties.clear();
QCOMPARE(obj.property("myuserproperty").toString(), QString("Hello"));