aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2020-05-10 16:06:57 +0200
committerChristian Kamm <mail@ckamm.de>2020-05-21 07:54:08 +0000
commit40dd6fc1859bf0b5345d368e9cb3d4eddadf7fc5 (patch)
tree25b3610fe94fc18b7173564761c5e6fee9156090 /tests/auto
parentf64146741df05d7da7429f66af079b24c11cc3ca (diff)
QmlJS: Add workaround for missing imports in Qt >=5.15.0
The QtQuick module plugins.qmltypes in Qt 5.15.0 do not contain QML types like QtObject. Instead, they are found in the QtQml module. Something similar applies to QtQml and QtQml.Models and QtQml.WorkerScript. As Qt 5.15 can't use the "import" command in the qmldir file, this code instead detects the 5.15 QtQuick and QtQml modules and adds the dependent imports manually, as a workaround. Change-Id: I982e349298eb7200372390dfc384fb43a762b253 Task-number: QTCREATORBUG-23986 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp
index 582fbd49fb..2496f7341d 100644
--- a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp
+++ b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp
@@ -234,13 +234,11 @@ void tst_ImportCheck::importTypes_data()
<< QStringList({ "Item", "QtObject", "IsQtQuickSimple" });
// QtQuick/ and QtQml/ with an implicit dependency
- // This is the situation in Qt 5.15.0 and will be made to work in a
- // follow-up commit.
- /*
+ // Seen in Qt 5.15.0.
QTest::newRow("QtQuick-workaround-QtQml")
<< QString(TESTSRCDIR "/importTypes/importQtQuick.qml")
<< QString(TESTSRCDIR "/importTypes/imports-QtQuick-workaround-QtQml")
- << QStringList({ "Item", "QtObject", "IsQtQuickWorkaround" });*/
+ << QStringList({ "Item", "QtObject", "IsQtQuickWorkaround" });
// QtQuick/ and QtQml/ with an "import" in the qmldir file
// Seen in Qt 6.