aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljstypereader.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-22 16:12:57 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-24 13:01:48 +0100
commit7ecd4b6d1f20fd729e9746cf41fe863cd382e42f (patch)
treea108815d9c009361bfbb0104b97c1bce61ac7ad1 /src/qmlcompiler/qqmljstypereader.cpp
parent74bf3c8c333c30f4d3b4db31b5cc0b5150a08c88 (diff)
qmllint: Resolve imported files by qrc path if available
If a file is part of the resource file system, the implicit directory is also in the resource file system. We can use QQmlJSResourceFileMapper to figure this out. Change-Id: I48d86c308c7ec38d9971b84e7f059daa3baf63ee Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljstypereader.cpp')
-rw-r--r--src/qmlcompiler/qqmljstypereader.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljstypereader.cpp b/src/qmlcompiler/qqmljstypereader.cpp
index 7cd7691050..db64a9426b 100644
--- a/src/qmlcompiler/qqmljstypereader.cpp
+++ b/src/qmlcompiler/qqmljstypereader.cpp
@@ -82,8 +82,11 @@ QQmlJSScope::Ptr QQmlJSTypeReader::operator()()
if (!rootNode)
return errorResult();
- QQmlJSImportVisitor membersVisitor(m_importer, QFileInfo(m_file).canonicalPath(),
- m_qmltypesFiles);
+ QQmlJSImportVisitor membersVisitor(
+ m_importer,
+ QQmlJSImportVisitor::implicitImportDirectory(
+ m_file, m_importer->resourceFileMapper()),
+ m_qmltypesFiles);
rootNode->accept(&membersVisitor);
auto result = membersVisitor.result();
result->setInternalName(scopeName);