aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-11-14 15:59:56 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-01-13 16:54:17 +0100
commit2677de3c79de984e88e4a950c915b4f3f54786dd (patch)
tree57a4cdf058f7af9d36c776955803e384853b361d /tests/auto/qml/qmllint/data
parent6c68a39a56299c72da30a4bac3ca7fe8420687a4 (diff)
qmllint: Assume "parent" property is always document parent
... except if the document parent is Component. Then leave the type alone. Change-Id: Id7b2e6efdefe18a8d375967ddedcdf9e07a07946 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint/data')
-rw-r--r--tests/auto/qml/qmllint/data/badParent.qml7
-rw-r--r--tests/auto/qml/qmllint/data/goodParent.qml8
-rw-r--r--tests/auto/qml/qmllint/data/parentIsComponent.qml13
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/badParent.qml b/tests/auto/qml/qmllint/data/badParent.qml
new file mode 100644
index 0000000000..f381f059cc
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badParent.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Item {
+ Item {
+ property int yyy: parent.rrr
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/goodParent.qml b/tests/auto/qml/qmllint/data/goodParent.qml
new file mode 100644
index 0000000000..413337713a
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/goodParent.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0
+
+Item {
+ property int rrr: 5
+ Item {
+ property int yyy: parent.rrr
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/parentIsComponent.qml b/tests/auto/qml/qmllint/data/parentIsComponent.qml
new file mode 100644
index 0000000000..a74bf9e4e8
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/parentIsComponent.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+
+Item {
+ Component {
+ id: foo
+ Item {
+ property real yyy: parent.progress
+ Component.onCompleted: console.log(yyy)
+ }
+ }
+
+ property var stuff: foo.createObject()
+}