diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-03 18:35:10 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-08 11:32:59 +0000 |
commit | 7745479aad79fc3a4bc88bd351b124acea447647 (patch) | |
tree | 0fea4a4e25da55c983cb775f1212d590912d4859 | |
parent | e9e28c743a3b8b3d10486254e87990ed9703cdea (diff) | |
download | qtdoc-7745479aad79fc3a4bc88bd351b124acea447647.tar.gz |
Fix alarms demo to run successfully
Previously it failed with
QQmlApplicationEngine failed to load component
qrc:/alarms/main.qml: No such file or directory
main.cpp was adjusted to use alarms/main.cpp but the resource file
locations were not changed.
Change them to match the expected path in main.cpp.
qtquickcontrols2.conf needs to stay in the root of the resource path,
so it's added via a separate resource.
Amends 302121874ea6e664ea2a59a07bff8fa06983c335
Fixes: QTBUG-100434
Change-Id: I3436e07600ca7dad8bba45274ba49dc6c137a938
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit c43d133e5233415260afbed78f7cda8b4dec680c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/tutorials/alarms/CMakeLists.txt | 10 | ||||
-rw-r--r-- | examples/tutorials/alarms/alarms.pro | 2 | ||||
-rw-r--r-- | examples/tutorials/alarms/controls_conf.qrc | 5 | ||||
-rw-r--r-- | examples/tutorials/alarms/qml.qrc | 3 |
4 files changed, 15 insertions, 5 deletions
diff --git a/examples/tutorials/alarms/CMakeLists.txt b/examples/tutorials/alarms/CMakeLists.txt index 7b454fe9..c7d8f451 100644 --- a/examples/tutorials/alarms/CMakeLists.txt +++ b/examples/tutorials/alarms/CMakeLists.txt @@ -36,16 +36,22 @@ set(qml_resource_files "AlarmModel.qml" "TumblerDelegate.qml" "main.qml" - "qtquickcontrols2.conf" ) qt6_add_resources(alarms "qml" PREFIX - "/" + "/alarms/" FILES ${qml_resource_files} ) +qt6_add_resources(alarms "controls_conf" + PREFIX + "/" + FILES + "qtquickcontrols2.conf" +) + install(TARGETS alarms RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/tutorials/alarms/alarms.pro b/examples/tutorials/alarms/alarms.pro index 14fc29a8..4e75fa52 100644 --- a/examples/tutorials/alarms/alarms.pro +++ b/examples/tutorials/alarms/alarms.pro @@ -4,7 +4,7 @@ QT += quick SOURCES += main.cpp -RESOURCES += qml.qrc +RESOURCES += qml.qrc controls_conf.qrc target.path = $$[QT_INSTALL_EXAMPLES]/demos/alarms INSTALLS += target diff --git a/examples/tutorials/alarms/controls_conf.qrc b/examples/tutorials/alarms/controls_conf.qrc new file mode 100644 index 00000000..4fbf17b7 --- /dev/null +++ b/examples/tutorials/alarms/controls_conf.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>qtquickcontrols2.conf</file> + </qresource> +</RCC> diff --git a/examples/tutorials/alarms/qml.qrc b/examples/tutorials/alarms/qml.qrc index ae9ac907..270febb2 100644 --- a/examples/tutorials/alarms/qml.qrc +++ b/examples/tutorials/alarms/qml.qrc @@ -1,7 +1,6 @@ <RCC> - <qresource prefix="/"> + <qresource prefix="/alarms/"> <file>main.qml</file> - <file>qtquickcontrols2.conf</file> <file>TumblerDelegate.qml</file> <file>AlarmModel.qml</file> <file>AlarmDelegate.qml</file> |