Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.5
-
None
-
Fedora 38
-
7f2f329dc (dev), 5dd4720bd (6.7), 1bef3c4d0 (dev), f1051cb48 (dev), fd29ef756 (tqtc/lts-6.5), 7729ed61a (dev)
Description
When developing KDE software I typically install everything into a folder in my home directory, e.g. "~/kde6/usr" and run things from there by setting environment variables like PATH, QT_PLUGIN_PATH and QML2_IMPORT_PATH to point to it. This includes QML modules like kirigami, which is e.g. installed to "/home/nico/kde6/usr/lib64/qml/org/kde/kirigami". QML2_IMPORT_PATH is then set to /home/nico/kde6/usr/lib64/qml.
This works fine for running the application, however there is a problem when trying to use qmllint on it
When running qmllint on a source file that imports Kirigami without further arguments I get a warning like
Warning: /home/nico/qmltest/main.qml:5:1: Warnings occurred while importing module "org.kde.kirigami": [import] import org.kde.kirigami 2 as Kirigami ^^^^^^ --- Warning: Failed to import org.kde.kirigami. Are your import paths set up properly? [import] ---
I can fix the warning by manually adding "-I /home/nico/kde6/usr/lib64/qml" to the qmllint call. That's tedious though.
When using the "make all_qmllint" target provided by qt_add_qml_module there seems to be no way for me to manually add the necessary import path, so I can't make it find Kirigami.
As a possible solution to this problem I suggest that qmllint could add the paths from QML2_IMPORT_PATH to the default search paths. That would fix running "make all_qmllint" in my setup.
Attachments
For Gerrit Dashboard: QTBUG-114969 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
545614,22 | cmake: Improve handling of imported QML module targets | dev | qt/qtdeclarative | Status: NEW | -1 | 0 |
496390,47 | Support targets for DEPENDENCIES/IMPORTS in qt_add_qml_module | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
554300,9 | qmlls: add -I and -E option | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
554703,7 | qmllint: enable environment variables like QML_IMPORT_PATH via -E | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
554704,5 | qmllint: do not ignore command line options with --ignore-settings | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
555711,3 | qmllint: do not ignore command line options with --ignore-settings | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
556499,2 | qmllint: do not ignore command line options with --ignore-settings | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |