aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/data/qmldirImportAndDepend
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-22 18:38:43 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-24 18:28:20 +0200
commit437b04e6ec5c767907a97af115d82b4cd7db93ae (patch)
tree6a6cb79149488e214a0068e69f9580ea3a5b572d /tests/auto/qml/qmllint/data/qmldirImportAndDepend
parent36df81b3bc6d721d5598d5163b0a9659de4a69ee (diff)
qmllint: Properly process qmldir imports and dependencies
We don't want to pick the dependencies from the qmltypes files. Rather, parse them directly from the qmldir. Do process versions, too. Also, import explicitly given qmltypes files only once, and don't expose QML types from dependencies as actual types. Hide them behind an inaccessible prefix. For the inaccessible prefix to work, we need to import the C++ class names without the prefix. The prefix doesn't make sense for C++ names anyway. In addition, properly process version-less imports. Change-Id: If582ad271db35351d219332c319571a814628fe0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint/data/qmldirImportAndDepend')
-rw-r--r--tests/auto/qml/qmllint/data/qmldirImportAndDepend/bad.qml5
-rw-r--r--tests/auto/qml/qmllint/data/qmldirImportAndDepend/good.qml10
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/qmldirImportAndDepend/bad.qml b/tests/auto/qml/qmllint/data/qmldirImportAndDepend/bad.qml
new file mode 100644
index 0000000000..ef80aa54d6
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/qmldirImportAndDepend/bad.qml
@@ -0,0 +1,5 @@
+import Things
+
+Item {
+ objectName: "We cannot instantiate Item as it is not imported"
+}
diff --git a/tests/auto/qml/qmllint/data/qmldirImportAndDepend/good.qml b/tests/auto/qml/qmllint/data/qmldirImportAndDepend/good.qml
new file mode 100644
index 0000000000..275b531845
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/qmldirImportAndDepend/good.qml
@@ -0,0 +1,10 @@
+import Things
+
+QtObject {
+ objectName: "QtQml was imported from Things/qmldir"
+
+ ItemDerived {
+ objectName: "QQuickItem is depended upon and we know its properties"
+ x: 4
+ }
+}