diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-12 23:00:20 +0300 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-12 23:00:20 +0300 |
| commit | 4826f86e274f1b29bd769e6790824f9e62a40f62 (patch) | |
| tree | c2cc4bb09ca91951a2641e33c3b0a65deb0af877 /src/qmlcompiler/qqmljsimportvisitor.cpp | |
| parent | 0f0972d542d9869c2dcfaf9c963d42ff32766460 (diff) | |
| parent | 844f9b9b376838bcb44324984876f8bf99d85d38 (diff) | |
Merge tag 'v6.5.7-lts-lgpl' into 6.56.5
Qt 6.5.7-lts-lgpl release
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index d07b70bb16..7db2821a5d 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -2207,10 +2207,12 @@ void QQmlJSImportVisitor::importFromHost(const QString &path, const QString &pre void QQmlJSImportVisitor::importFromQrc(const QString &path, const QString &prefix, const QQmlJS::SourceLocation &location) { - if (const auto &mapper = m_importer->resourceFileMapper()) { - if (mapper->isFile(path)) { + Q_ASSERT(path.startsWith(u':')); + if (const QQmlJSResourceFileMapper *mapper = m_importer->resourceFileMapper()) { + const auto pathNoColon = path.mid(1); + if (mapper->isFile(pathNoColon)) { const auto entry = m_importer->resourceFileMapper()->entry( - QQmlJSResourceFileMapper::resourceFileFilter(path)); + QQmlJSResourceFileMapper::resourceFileFilter(pathNoColon)); const auto scope = m_importer->importFile(entry.filePath); const QString actualPrefix = prefix.isEmpty() ? QFileInfo(entry.resourcePath).baseName() : prefix; |
