summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlbinding
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmlbinding')
-rw-r--r--tests/auto/declarative/qmlbinding/data/test-binding.qml2
-rw-r--r--tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/declarative/qmlbinding/data/test-binding.qml b/tests/auto/declarative/qmlbinding/data/test-binding.qml
index d2a22f5..e9101e4 100644
--- a/tests/auto/declarative/qmlbinding/data/test-binding.qml
+++ b/tests/auto/declarative/qmlbinding/data/test-binding.qml
@@ -10,7 +10,7 @@ Rectangle {
Rectangle { id: r1; width: 1; height: 1; color: "yellow" }
Rectangle { id: r2; width: 1; height: 1; color: "red" }
- Binding { target: screen; property: "text"; value: s1.text }
+ Binding { target: screen; property: "text"; value: s1.text; objectName: "binding1" }
Binding { target: screen; property: "color"; value: r1.color }
Binding { target: screen; property: "color"; when: screen.changeColor == true; value: r2.color }
}
diff --git a/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp b/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp
index e5aacc7..0a8508a 100644
--- a/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp
+++ b/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp
@@ -77,6 +77,12 @@ void tst_qmlbinding::binding()
rect->setProperty("changeColor", true);
QCOMPARE(rect->color(), QColor("red"));
+ QmlBind *binding = qobject_cast<QmlBind*>(rect->findChild<QmlBind*>("binding1"));
+ QVERIFY(binding != 0);
+ QCOMPARE(binding->object(), rect);
+ QCOMPARE(binding->property(), QLatin1String("text"));
+ QCOMPARE(binding->value().toString(), QLatin1String("Hello"));
+
delete rect;
}