summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-08 04:27:04 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-08 04:27:56 (GMT)
commita8247ce85808614f6ec921a37bae9fb0d447252b (patch)
treed5b280d784c239ebea328a6b6b5d23946c0c26e9 /tests
parent224189f1531bc9e2e25b9ea72038e240bd3550a9 (diff)
downloadQt-a8247ce85808614f6ec921a37bae9fb0d447252b.zip
Qt-a8247ce85808614f6ec921a37bae9fb0d447252b.tar.gz
Qt-a8247ce85808614f6ec921a37bae9fb0d447252b.tar.bz2
Autotest for 76f5e9e7d1eea8d688d5459b7b7b2bfa3f9057ed
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp11
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
index a902312..566f5ed 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
@@ -1,4 +1,5 @@
import Qt.test 1.0
+import Qt 4.6
MyExtendedObject
{
@@ -7,4 +8,12 @@ MyExtendedObject
coreProperty: extendedProperty
extendedProperty: 9
+
+ property QtObject nested: MyExtendedObject {
+ baseProperty: baseExtendedProperty
+ baseExtendedProperty: 13
+
+ coreProperty: extendedProperty
+ extendedProperty: 9
+ }
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 77dd4b8..8e73afa 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -543,11 +543,20 @@ void tst_qdeclarativeecmascript::extensionObjects()
QVERIFY(object != 0);
QCOMPARE(object->baseProperty(), 13);
QCOMPARE(object->coreProperty(), 9);
-
object->setProperty("extendedProperty", QVariant(11));
object->setProperty("baseExtendedProperty", QVariant(92));
QCOMPARE(object->coreProperty(), 11);
QCOMPARE(object->baseProperty(), 92);
+
+ MyExtendedObject *nested = qobject_cast<MyExtendedObject*>(qvariant_cast<QObject *>(object->property("nested")));
+ QVERIFY(nested);
+ QCOMPARE(nested->baseProperty(), 13);
+ QCOMPARE(nested->coreProperty(), 9);
+ nested->setProperty("extendedProperty", QVariant(11));
+ nested->setProperty("baseExtendedProperty", QVariant(92));
+ QCOMPARE(nested->coreProperty(), 11);
+ QCOMPARE(nested->baseProperty(), 92);
+
}
void tst_qdeclarativeecmascript::attachedProperties()