diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21580.qml | 22 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 13 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21580.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21580.qml new file mode 100644 index 0000000000..dc0066ba3f --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21580.qml @@ -0,0 +1,22 @@ +import QtQuick 2.0 + +QtObject { + property bool test: false + + property list<QtObject> objects: [ + QtObject { + id: first + property alias myAlias: other.myProperty + onMyAliasChanged: if (myAlias == 20) test = true + }, + QtObject { + id: other + property real myProperty + } + ] + + Component.onCompleted: { + other.myProperty = 20; + } +} + diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 7d9819b193..4c43a02e81 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -178,6 +178,7 @@ private slots: void sequenceConversionBindings(); void sequenceConversionCopy(); void qtbug_22464(); + void qtbug_21580(); void bug1(); void bug2(); void dynamicCreationCrash(); @@ -1656,6 +1657,18 @@ void tst_qdeclarativeecmascript::qtbug_22464() delete object; } +void tst_qdeclarativeecmascript::qtbug_21580() +{ + QDeclarativeComponent component(&engine, TEST_FILE("qtbug_21580.qml")); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test").toBool(), true); + + delete object; +} + // QTBUG-6781 void tst_qdeclarativeecmascript::bug1() { |