Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1846

qmlImportPaths documentation contains error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 3.0.1
    • Documentation
    • None
    • All
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rweickelt Richard Weickelt
            vitaly_sokolov Vitaly Sokolov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes