From d166e34bade3b7c82f610f5df209b6418df9e178 Mon Sep 17 00:00:00 2001 From: Matthew Vogt Date: Fri, 13 Jul 2012 10:44:39 +1000 Subject: Update multiple value type properties despite interceptor When an interceptor is present on a value type, ensure that multiple properties of that value can be updated simultaneously. Task-number: QTBUG-25139 Change-Id: I3042b9883d404aed4b6507e6d2f38a76caee1196 Reviewed-by: Glenn Watson Reviewed-by: Michael Brasser --- .../quick/qquickbehaviors/tst_qquickbehaviors.cpp | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp') diff --git a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp index bd17bf4143..be7ad304b6 100644 --- a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp +++ b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp @@ -80,6 +80,7 @@ private slots: void sameValue(); void delayedRegistration(); void startOnCompleted(); + void multipleChangesToValueType(); }; void tst_qquickbehaviors::simpleBehavior() @@ -468,6 +469,32 @@ void tst_qquickbehaviors::startOnCompleted() delete rect; } +//QTBUG-25139 +void tst_qquickbehaviors::multipleChangesToValueType() +{ + QQmlEngine engine; + + QQmlComponent c(&engine, testFileUrl("multipleChangesToValueType.qml")); + QScopedPointer rect(qobject_cast(c.create())); + QVERIFY(rect != 0); + + QQuickText *text = rect->findChild(); + QVERIFY(text != 0); + + QFont value; + value.setPointSize(24); + QCOMPARE(text->property("font").value(), value); + + QVERIFY(QMetaObject::invokeMethod(rect.data(), "updateFontProperties")); + + value.setItalic(true); + value.setWeight(QFont::Bold); + QCOMPARE(text->property("font").value(), value); + + value.setPointSize(48); + QTRY_COMPARE(text->property("font").value(), value); +} + QTEST_MAIN(tst_qquickbehaviors) #include "tst_qquickbehaviors.moc" -- cgit v1.2.3