diff --git a/doc/qtdesignstudio/examples/Loginui1/src/main.cpp b/doc/qtdesignstudio/examples/Loginui1/src/main.cpp index 1df03ed16b6..eacbde58784 100644 --- a/doc/qtdesignstudio/examples/Loginui1/src/main.cpp +++ b/doc/qtdesignstudio/examples/Loginui1/src/main.cpp @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - const QUrl url(u"qrc:Main/main.qml"_qs); + const QUrl url(u"qrc:/qt/qml/Main/main.qml"_qs); QObject::connect( &engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.content.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.content.txt.tpl index a95da583f37..a5a4360e3f2 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.content.txt.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.content.txt.tpl @@ -5,6 +5,7 @@ qt_add_library(content STATIC) qt6_add_qml_module(content URI "content" VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" QML_FILES App.qml %{UIClassFileName} diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/common/main.cpp.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/common/main.cpp.tpl index 53c355b6b8a..915d08462e2 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/common/main.cpp.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/common/main.cpp.tpl @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - const QUrl url(u"qrc:Main/main.qml"_qs); + const QUrl url(u"qrc:/qt/qml/Main/main.qml"_qs); QObject::connect( &engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/common/qmlmodules.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/common/qmlmodules.tpl index fa3069a770a..5a22661b5a1 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/common/qmlmodules.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/common/qmlmodules.tpl @@ -4,6 +4,7 @@ qt6_add_qml_module(${CMAKE_PROJECT_NAME} URI "Main" VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" NO_PLUGIN QML_FILES main.qml ) diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/CMakeLists.content.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/CMakeLists.content.txt.tpl index 255afffa3ea..5601c89997d 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/CMakeLists.content.txt.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/CMakeLists.content.txt.tpl @@ -5,6 +5,7 @@ qt_add_library(content STATIC) qt6_add_qml_module(content URI "content" VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" QML_FILES App.qml Screen01.ui.qml diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/CMakeLists.content.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/CMakeLists.content.txt.tpl index 255afffa3ea..5601c89997d 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/CMakeLists.content.txt.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/CMakeLists.content.txt.tpl @@ -5,6 +5,7 @@ qt_add_library(content STATIC) qt6_add_qml_module(content URI "content" VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" QML_FILES App.qml Screen01.ui.qml diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl index df10020cb23..517b91355a7 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl @@ -8,11 +8,12 @@ set_source_files_properties(Constants.qml ) qt6_add_qml_module(%{ImportModuleName} - URI "%{ImportModuleName}" - VERSION 1.0 - QML_FILES - Constants.qml - DirectoryFontLoader.qml - EventListModel.qml - EventListSimulator.qml + URI "%{ImportModuleName}" + VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" + QML_FILES + Constants.qml + DirectoryFontLoader.qml + EventListModel.qml + EventListSimulator.qml ) diff --git a/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmaincpp.tpl b/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmaincpp.tpl index cedd80d76dd..0ff9201d916 100644 --- a/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmaincpp.tpl +++ b/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmaincpp.tpl @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - const QUrl url(u"qrc:Main/main.qml"_qs); + const QUrl url(u"qrc:/qt/qml/Main/main.qml"_qs); QObject::connect( &engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { diff --git a/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodulecmakelists.tpl b/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodulecmakelists.tpl index e193ebf5ba1..93573a1ed7a 100644 --- a/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodulecmakelists.tpl +++ b/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodulecmakelists.tpl @@ -7,5 +7,6 @@ qt_add_library(%2 STATIC) qt6_add_qml_module(%2 URI "%3" VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" %4 ) diff --git a/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodules.tpl b/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodules.tpl index a1fdb4071dc..2b74c49af38 100644 --- a/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodules.tpl +++ b/src/plugins/qmlprojectmanager/cmakegen/qmlprojectmodules.tpl @@ -4,6 +4,7 @@ qt6_add_qml_module(%1 URI "Main" VERSION 1.0 + RESOURCE_PREFIX "/qt/qml" NO_PLUGIN QML_FILES main.qml )