Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.13.0-beta2
-
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:
- 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.