aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-02-15 11:51:25 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2018-05-25 09:15:16 +0000
commit8274f78ffd1a7f1b8295e7a4dd653dd107f22acb (patch)
tree62f2e087602ff7001761428b967ed6bd6f48adca /tests/auto/qml/qqmllanguage/data
parent3b4d27bf55348751ff6b454e834c0d0634d759b4 (diff)
Correctly set this object when calling scope/context functions5.6
When a function is called that is in a QML scope or a QML context, set the 'this' object to the QML scope. Note: this patch is 5.9 specific. 5.11 has a similair issue, but the implementation is quite different, so that needs a separate fix. Task-number: QTBUG-59357 Change-Id: Ia78e012d413c40a094e957f4020502cd055ac286 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit b2420780df98cb3c98553da18a5b1bc5b64e9e83)
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data')
-rw-r--r--tests/auto/qml/qqmllanguage/data/thisInQmlScope.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/thisInQmlScope.qml b/tests/auto/qml/qqmllanguage/data/thisInQmlScope.qml
new file mode 100644
index 0000000000..e3c99e70e1
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/thisInQmlScope.qml
@@ -0,0 +1,10 @@
+import QtQml 2.2
+QtObject {
+ property int x: 42
+ property int y: 0
+ function g(){
+ y = this.x;
+ }
+ property var f: g
+ Component.onCompleted: f()
+}