Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
Description
Case study
Project contents
<ROOT>/CMakeLists.txt <ROOT>/main.h <ROOT>/main.cpp <ROOT>/main.qml <ROOT>/MyLib/CMakeLists.txt <ROOT>/MyLib/GreenRect.qml <ROOT>/MyLib/RedRect.qml
- Build and run the attached project. It currently doesn't run correctly because we forgot to add "RedRect.qml" to the project.
- Open main.qml. Notice the "Unknown component" error, as expected.
- Fix "MyLib/CMakeLists.txt" by adding "RedRect.qml" to "QML_FILES".
- Build and run the project again. Notice that CMake has re-run, RedRect.qml is now in the project tree, and the application now runs correctly.
However, the "Unknown component" error remains. We need to manually click "Tools" > "QML/JS" > "Reset Code Model" to make the error go away.
Suggestions
- Add a default keyboard shortcut for "Reset Code Model", so that users don't need to make a custom one in order to avoid clicking 3 levels of menus.
- Add an option to automatically reset the code model whenever CMake re-runs