aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript
diff options
context:
space:
mode:
authorGlenn Watson <glenn.watson@nokia.com>2011-11-22 09:13:21 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-22 03:31:11 +0100
commit0bf08af2b945f10f44561ffa0abd6f89b093b376 (patch)
treef7cb7e6cd3061eaf3878bf8787708ed03428c07e /tests/auto/declarative/qdeclarativeecmascript
parent3ef0ce6b794ed58d26ec6355cc13fd00f66c5176 (diff)
Fix default property preventing signals from being emitted.
Change the way connectAlias works so that even if the target for the connection is not available immediately, anything that is bound to it is notified when the target is changed. (Fix is authored by Aaron). Task-number: QTBUG-21580 Change-Id: Ida23c0e620069c50b123c71b5078929d4c7ec4e4 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21580.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp13
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()
{