diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-11-09 14:13:41 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-16 13:04:50 +0100 |
commit | cb26606bc2116f3cabd9cb5dde1d3ed7577a26a7 (patch) | |
tree | ee46eab797b51887574cbd670855a90efe72fffe /tests/auto/declarative/qdeclarativeecmascript | |
parent | e443db45847dcd42c0725b7df8fbda55717ad0e1 (diff) |
Allow aliases to QVariant properties
Task-number: QTBUG-22464
Change-Id: I449d4fc709d34a69116258660d721596cd9b778b
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22464.qml | 15 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 14 |
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22464.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22464.qml new file mode 100644 index 0000000000..19f26736f1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22464.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +QtObject { + property alias value: inner.value + property bool test: false + + property variant dummy: QtObject { + id: inner + property variant value: Qt.rgba(1, 1, 0, 1); + } + + Component.onCompleted: { + test = (value == Qt.rgba(1, 1, 0, 1)); + } +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 11e33bec1d..e784ffbce3 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -177,7 +177,7 @@ private slots: void sequenceConversionThreads(); void sequenceConversionBindings(); void sequenceConversionCopy(); - + void qtbug_22464(); void bug1(); void bug2(); void dynamicCreationCrash(); @@ -1643,6 +1643,18 @@ void tst_qdeclarativeecmascript::undefinedResetsProperty() } } +// Aliases to variant properties should work +void tst_qdeclarativeecmascript::qtbug_22464() +{ + QDeclarativeComponent component(&engine, TEST_FILE("qtbug_22464.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test").toBool(), true); + + delete object; +} + // QTBUG-6781 void tst_qdeclarativeecmascript::bug1() { |