Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.5.4
-
None
Description
Running qmlimportscanner against QML files silently results in output which only includes the module names, but not their versions.
Simple input QML file:
> grep ^import Page.qml import QtQuick 2.5 import QtQuick.Layouts 1.2 import QtQuick.Templates 2.1 as T2 import QtQuick.Controls 2.1 as QQC2 import org.kde.kirigami 2.10 as Kirigami import "private" as P
> ./libexec/qt6/qmlimportscanner -qmlFiles Page.qml [ { "name": "QtQuick", "type": "module" }, { "name": "QtQuick.Layouts", "type": "module" }, { "name": "QtQuick.Templates", "type": "module" }, { "name": "QtQuick.Controls", "type": "module" }, { "name": "org.kde.kirigami", "type": "module" }, { "name": "private", "path": "Page.qml/private", "type": "directory" } ]
With an older version (in this case 5.15), it works as expected:
> qmlimportscanner-qt5 -qmlFiles Page.qml [ { "name": "QtQuick", "type": "module", "version": "2.5" }, { "name": "QtQuick.Layouts", "type": "module", "version": "1.2" }, { "name": "QtQuick.Templates", "type": "module", "version": "2.1" }, { "name": "QtQuick.Controls", "type": "module", "version": "2.1" }, { "name": "org.kde.kirigami", "type": "module", "version": "2.10" }, { "name": "private", "path": "Page.qml/private", "type": "directory" } ]
It works after removing a single line in qmlimportscanner:
diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp index 7c8f1bc98e..c8635323ce 100644 --- a/tools/qmlimportscanner/main.cpp +++ b/tools/qmlimportscanner/main.cpp @@ -434,7 +434,6 @@ getImportDetails(const QVariant &inputImport, import.insert(preferLiteral(), prefer); } } - import.remove(versionLiteral()); const ImportDetailsAndDeps result = {import, dependencies}; cache.insert({inputImport, result});
Attachments
Issue Links
- resulted from
-
QTBUG-103187 Reconfiguration is slow due to qmlimportscanner
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-115170 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
538254,3 | qmlimportscanner: Optionally add version to output again | dev | qt/qtdeclarative | Status: NEW | -1 | 0 |