diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/bindingContainingQProperty.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/bindingContainingQProperty.qml b/tests/auto/qml/qqmlecmascript/data/bindingContainingQProperty.qml new file mode 100644 index 0000000000..52b7122ef0 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/bindingContainingQProperty.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +ClassWithQProperty { + property real expected: value +} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index c37d2b0990..ef2eb5ad03 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -383,6 +383,7 @@ private slots: void hugeStack(); void bindingOnQProperty(); void bindingOnQPropertyContextProperty(); + void bindingContainingQProperty(); void urlConstruction(); void urlPropertyInvalid(); void urlPropertySet(); @@ -9189,6 +9190,17 @@ void tst_qqmlecmascript::bindingOnQPropertyContextProperty() // QCOMPARE(classWithQProperty->value.value(), 2); } +void tst_qqmlecmascript::bindingContainingQProperty() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("bindingContainingQProperty.qml")); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + QScopedPointer<QObject> test(component.create()); + QVERIFY(!test.isNull()); + test->setProperty("value", 42.0); + QCOMPARE(test->property("expected"), 42.0); +} + void tst_qqmlecmascript::urlConstruction() { QQmlEngine qmlengine; |