diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp index 483d588..8ab7b0b 100644 --- a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp +++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp @@ -69,14 +69,20 @@ void tst_qdeclarativebinding::binding() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding.qml")); QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); - QVERIFY(rect != 0); + + QDeclarativeBind *binding3 = qobject_cast<QDeclarativeBind*>(rect->findChild<QDeclarativeBind*>("binding3")); + QVERIFY(binding3 != 0); + QCOMPARE(rect->color(), QColor("yellow")); QCOMPARE(rect->property("text").toString(), QString("Hello")); + QCOMPARE(binding3->when(), false); rect->setProperty("changeColor", true); QCOMPARE(rect->color(), QColor("red")); + QCOMPARE(binding3->when(), true); + QDeclarativeBind *binding = qobject_cast<QDeclarativeBind*>(rect->findChild<QDeclarativeBind*>("binding1")); QVERIFY(binding != 0); QCOMPARE(binding->object(), qobject_cast<QObject*>(rect)); |