summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-04-15 01:48:06 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-04-15 01:48:06 (GMT)
commitb4b85257ccff6ba21bcbcbd46a9f7f09884abe79 (patch)
tree394547f947fcc2b1f1e9cc75bb779509d08bd356 /tests/auto/declarative/qdeclarativeecmascript/data
parentead56475cc6ecd7a6e7e17d63f0e22cf930bcae4 (diff)
downloadQt-b4b85257ccff6ba21bcbcbd46a9f7f09884abe79.zip
Qt-b4b85257ccff6ba21bcbcbd46a9f7f09884abe79.tar.gz
Qt-b4b85257ccff6ba21bcbcbd46a9f7f09884abe79.tar.bz2
Resolve unqualified attached properties correctly
When resolving unqualified attached properties, we should use the scope object, not the context object. Otherwise they will always resolve to the root object of the context, regardless of where they are written. In this example, QtObject { id: root QtObject { id: me property int a: AttachedObject.x } } the attached object should be loaded on the "me" object, not the "root" object. Change-Id: I386f886f62df7b8020c3ff703cdfc891d5739713 Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
new file mode 100644
index 0000000..a7184c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
@@ -0,0 +1,22 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ property alias a: me.a
+ property alias b: me.a
+ property alias c: me.a
+ property alias d: me.a
+
+ property MyQmlObject obj
+ obj: MyQmlObject {
+ MyQmlObject.value2: 13
+
+ id: me
+ property int a: MyQmlObject.value2 * 2
+ property int b: Namespace.MyQmlObject.value2 * 2
+ property int c: me.Namespace.MyQmlObject.value * 2
+ property int d: me.Namespace.MyQmlObject.value * 2
+ }
+}
+
+