diff options
Diffstat (limited to 'tests/auto/declarative/qmllanguage')
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/dynamicObjectProperties.qml | 13 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 14 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllanguage/data/dynamicObjectProperties.qml b/tests/auto/declarative/qmllanguage/data/dynamicObjectProperties.qml new file mode 100644 index 0000000..e69ccee --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/dynamicObjectProperties.qml @@ -0,0 +1,13 @@ +import Test 1.0 +import Qt 4.6 +import Qt 4.6 as Qt + +Object { + property Object objectProperty + property Object objectProperty2 + objectProperty2: Object {} + + property MyComponent myComponentProperty + property MyComponent myComponentProperty2 + myComponentProperty2: MyComponent {} +} diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 1bf98df..3825b62 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -45,6 +45,7 @@ private slots: void idProperty(); void assignSignal(); void dynamicProperties(); + void dynamicObjectProperties(); void dynamicSignalsAndSlots(); void simpleBindings(); void autoComponentCreation(); @@ -404,6 +405,19 @@ void tst_qmllanguage::dynamicProperties() QCOMPARE(object->property("variantProperty"), QVariant(12)); } +// Tests the creation and assignment of dynamic object properties +// ### Not complete +void tst_qmllanguage::dynamicObjectProperties() +{ + QmlComponent component(&engine, TEST_FILE("dynamicObjectProperties.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + QVERIFY(object->property("objectProperty") == qVariantFromValue((QObject*)0)); + QVERIFY(object->property("objectProperty2") != qVariantFromValue((QObject*)0)); +} + // Tests the declaration of dynamic signals and slots void tst_qmllanguage::dynamicSignalsAndSlots() { |