summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-01-28 02:00:21 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-01-28 02:00:21 (GMT)
commitcb6b9ee680f792750d0cb265ea59ff3ff4643562 (patch)
tree4c735bd8cde722945b893b4aad389daca709254c /tests
parent547e2162c872ca5707f5bc54d06b3c39c9bd6477 (diff)
downloadQt-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')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp9
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)