Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
3.0.1
-
None
-
-
All
Description
According to Qt sources (qt/qtdeclarative/tools/qmlimportscanner/main.cpp, method QPair<QString, QString> resolveImportPath(const QString&, const QString&)), "path/to/qml" is added automatically as the "relativePath" variable. Only sourceDirectory is needed to create an absolute path to the directory for searching.
However, the documentation states that the full path to the directory containing QML files should be specified (qbs/doc/appendix/qbs-porting.qdoc and https://doc.qt.io/qbs/porting-to-qbs.html#qml-import-path)
For example:
uri: "company.myplugin";
myplugin.qbs directory: /home/user/.../project/myplugin (also set as sourceDirectory);
myplugin's QML directory: /home/user/.../project/myplugin/company/myplugin;
When the plugin path is being resolved, the "relativePath" variable is created (uri "company.myplugin" transforms into "company/myplugin") and appended via a slash to the module's qmlImportPath.
If [sourceDirectory + "company/muplugin"] is specified as a path to QML files (as indicated in the documentation), then relativePath "company/myplugin" is also added, which causes a non-existent directory "/home/user/.../project/myplugin/company/myplugin/company/myplugin" to be checked. As a result, the plugin cannot be found