diff options
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/jsObject.qml | 12 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/jsObject.qml b/tests/auto/declarative/qmlecmascript/data/jsObject.qml new file mode 100644 index 0000000..4128c92 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/jsObject.qml @@ -0,0 +1,12 @@ +import Qt 4.6 + +QtObject { + property int test + + Component.onCompleted: { + var o = new Object; + o.test = 92; + test = o.test; + } +} + diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index ba23ef8..4c9721a 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -115,6 +115,7 @@ private slots: void shutdownErrors(); void externalScript(); void compositePropertyType(); + void jsObject(); void bug1(); @@ -1062,6 +1063,18 @@ void tst_qmlecmascript::compositePropertyType() delete object; } +// QTBUG-5759 +void tst_qmlecmascript::jsObject() +{ + QmlComponent component(&engine, TEST_FILE("jsObject.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test").toInt(), 92); + + delete object; +} + // QTBUG-6781 void tst_qmlecmascript::bug1() { |