From e33c15c75d8e6a37ec939bb30ddcf66914e934ad Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 20 Nov 2023 13:59:15 +0100 Subject: [PATCH] Qt Quick/DS wizard: Fix the QML import path The wizard builds custom components to a "qml" subdirectory, which the QML engine is told about in main.cpp, but we need to tell the code model too, with a QML_IMPORT_PATH cache variable. Without this, the QML editor shows errors for the module imports. Change-Id: Ie48e809e2d51cc796c6c6c186a81c67e23a3609b Reviewed-by: Reviewed-by: Alessandro Portale --- .../studio_templates/projects/common/CMakeLists.main.txt.tpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl index 0adf6e1c98e..7d37f481602 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl @@ -44,3 +44,7 @@ install(TARGETS %{ProjectName}App LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + +# make IDEs aware of the QML import path +set(QML_IMPORT_PATH ${PROJECT_BINARY_DIR}/qml CACHE PATH + "Path to the custom QML components defined by the project")