diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-01-28 02:00:21 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-01-28 02:00:21 (GMT) |
commit | cb6b9ee680f792750d0cb265ea59ff3ff4643562 (patch) | |
tree | 4c735bd8cde722945b893b4aad389daca709254c /tests/auto/declarative | |
parent | 547e2162c872ca5707f5bc54d06b3c39c9bd6477 (diff) | |
download | Qt-cb6b9ee680f792750d0cb265ea59ff3ff4643562.zip Qt-cb6b9ee680f792750d0cb265ea59ff3ff4643562.tar.gz Qt-cb6b9ee680f792750d0cb265ea59ff3ff4643562.tar.bz2 |
Ensure simple objects also get the appropriate property cache
Task-number: QTBUG-13849
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml | 14 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml new file mode 100644 index 0000000..81ea536 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml @@ -0,0 +1,14 @@ +import Qt.test 1.1 +import QtQuick 1.0 + +QtObject { + property variant a + property real test + + a: MyRevisionedClass { + prop2: 11 + + Component.onCompleted: test = prop2 + } +} + diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index e7f9a2c..f66cd0b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -2983,6 +2983,15 @@ void tst_qdeclarativeecmascript::revision() MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); QVERIFY(object != 0); } + // Test that non-root classes can resolve revisioned methods + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision4.qml")); + + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(object->property("test").toReal(), 11.); + delete object; + } } QTEST_MAIN(tst_qdeclarativeecmascript) |