diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-12 01:14:04 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-12 01:14:04 (GMT) |
commit | 4d6958dd6d62441d98826ce141b5824d7eb0dfb0 (patch) | |
tree | 4b7edd4c6113fcb475d63ef970e0ab21d3050d71 /tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | |
parent | de4d752b3b1c475e1d5b7bf1539fa6a80a52ba1d (diff) | |
download | Qt-4d6958dd6d62441d98826ce141b5824d7eb0dfb0.zip Qt-4d6958dd6d62441d98826ce141b5824d7eb0dfb0.tar.gz Qt-4d6958dd6d62441d98826ce141b5824d7eb0dfb0.tar.bz2 |
The root object is always last default object
Fix for QT-2301
Diffstat (limited to 'tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 5e04f7c..f976e41 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -62,6 +62,7 @@ private slots: void selfDeletingBinding(); void extendedObjectPropertyLookup(); void scriptErrors(); + void signalTriggeredBindings(); private: QmlEngine engine; @@ -759,6 +760,33 @@ void tst_qmlecmascript::scriptErrors() QVERIFY(object != 0); } +/* +Test bindings still work when the reeval is triggered from within +a signal script. +*/ +void tst_qmlecmascript::signalTriggeredBindings() +{ + QmlComponent component(&engine, TEST_FILE("signalTriggeredBindings.qml")); + MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->property("base").toReal(), 50.); + QCOMPARE(object->property("test1").toReal(), 50.); + QCOMPARE(object->property("test2").toReal(), 50.); + + object->basicSignal(); + + QCOMPARE(object->property("base").toReal(), 200.); + QCOMPARE(object->property("test1").toReal(), 200.); + QCOMPARE(object->property("test2").toReal(), 200.); + + object->argumentSignal(10, QString(), 10); + + QCOMPARE(object->property("base").toReal(), 400.); + QCOMPARE(object->property("test1").toReal(), 400.); + QCOMPARE(object->property("test2").toReal(), 400.); +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" |