diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-12-09 11:22:52 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-12-13 16:31:51 +0000 |
commit | 17feb7753607c51eee8a624fd9e4e19d48a0a793 (patch) | |
tree | c3307e0931216f0fcbdcd67204c9e82518515caa /src/qmlcompiler/qqmljsimportvisitor.cpp | |
parent | 9d2bd53fda855dd8795bca583cbcb3eca66a6bc6 (diff) |
Pass qmldir to qmlcachegen, qmllint and qmltc, not the qmltypes file
The tools will still grudgingly accept qmltypes files being passed via
the -i option. We generally expect qmldir files, though. Ignoring the
qmldir file and importing the qmltypes directly, ignores qmldir imports,
dependencies and other component entries. This leads to unresolvable
types.
[ChangeLog][QML Tooling] qmllint expects qmldir files, not qmltypes
files to be passed via the -i option now. This enables it to see the
imports and dependencies of the module being imported. For backwards
compatibility it still accepts qmltypes files, with a warning.
Fixes: QTBUG-99043
Change-Id: I5ed32d7e78df1e604aaf1bfa2ebda09d5d57b628
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 576fafd1e69429d7387e4c35f6d15fc42af6513e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
-rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index 7c695395cb..e7e0443339 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -75,9 +75,9 @@ inline QString getScopeName(const QQmlJSScope::ConstPtr &scope, QQmlJSScope::Sco QQmlJSImportVisitor::QQmlJSImportVisitor(QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, - const QStringList &qmltypesFiles) + const QStringList &qmldirFiles) : m_implicitImportDirectory(implicitImportDirectory), - m_qmltypesFiles(qmltypesFiles), + m_qmldirFiles(qmldirFiles), m_currentScope(QQmlJSScope::create(QQmlJSScope::JSFunctionScope)), m_importer(importer), m_logger(logger) @@ -321,8 +321,8 @@ void QQmlJSImportVisitor::importBaseModules() addImportWithLocation(name, invalidLoc); } - if (!m_qmltypesFiles.isEmpty()) - m_importer->importQmltypes(m_qmltypesFiles); + if (!m_qmldirFiles.isEmpty()) + m_importer->importQmldirs(m_qmldirFiles); // Pulling in the modules and neighboring qml files of the qmltypes we're trying to lint is not // something we need to do. |