Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-24405

QML_IMPORT_PATH issue

    XMLWordPrintable

Details

    • 6ea088c02f9b0c61a8e9df1472b0ddfe544eb601 (qt-creator/qt-creator/master)

    Description

      The qmake variable QML_IMPORT_PATH seems to be sensitive to the order in which arguments are listed, and this is causing Qt Creator to throw incorrect syntax/missing import errors when two modules share similar path parts.

      I've attached an example project in this folder. It contains three folders:

      • import1, which contains the QML Foo.Bar module.
      • import2, which contains the QML Foo.Bar.Toolkit module.
      • simple_project, which is an empty QML project that imports both modules.

      Importantly, the project builds and runs. There are no issues with the project itself; this is a Qt creator issue.
      If you open up the project in QtCreator and navigate to `main.qml`, you'll notice that while "Foo.Bar.Toolkit" imports, there is an issue importing "Foo.Bar" (as seen in screenshot failure_1.png).

      This seems to be caused by line 21 in `simple_project.pro` where the order of arguments is:

      1. Additional import path used to resolve QML modules in Qt Creator's code model
        QML_IMPORT_PATH += \
        $$clean_path($$PWD/../import2) \
        $$clean_path($$PWD/../import1)
        ```
        If the order of folders `import1` and `import2` are reversed, the import system works, but in the current order of arguments exhibits this QtCreator bug.

      Attachments

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

        Activity

          People

            tjenssen Tim Jenssen
            shmittal Shveta Mittal (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes