aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-22 09:31:30 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-24 08:33:28 +0100
commite3ac1db9abe0cef47648072dbe2327be7299c7d4 (patch)
tree5a75b1277af3d7ea42ce7ba58cc24b0a1758a350 /tests
parent120eb155ef1f0da51c473b080880169a85e5ceb2 (diff)
qmllint: Support enum types from other scopes
In qmltypes, enum types can be scoped, just like in C++. Resolve those scopes. Also, resolve the enum scopes only once, in order not to duplicate the types. Change-Id: I095ec11f0ffec8e0e5f1034023c8956d2d39f660 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 75b99a10b3229c7ed14ded8622f3334c3cd02af5)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmllint/data/Things/plugins.qmltypes1
-rw-r--r--tests/auto/qml/qmllint/data/externalEnumProperty.qml5
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
index 99e1fdc466..9ad8c71468 100644
--- a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
+++ b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
@@ -62,5 +62,6 @@ Module {
exports: [
"Things/ItemDerived 1.0"
]
+ Property { name: "alignment"; type: "Qt::Alignment" }
}
}
diff --git a/tests/auto/qml/qmllint/data/externalEnumProperty.qml b/tests/auto/qml/qmllint/data/externalEnumProperty.qml
new file mode 100644
index 0000000000..2ba56a03a4
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/externalEnumProperty.qml
@@ -0,0 +1,5 @@
+import Things
+
+ItemDerived {
+ alignment: Qt.AlignCenter
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index db44193871..9c0077582e 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -382,6 +382,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("layouts depends quick") << QStringLiteral("layouts.qml");
QTest::newRow("attached") << QStringLiteral("attached.qml");
QTest::newRow("enumProperty") << QStringLiteral("enumProperty.qml");
+ QTest::newRow("externalEnumProperty") << QStringLiteral("externalEnumProperty.qml");
}
void TestQmllint::cleanQmlCode()