diff options
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml | 9 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 11 |
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() |