diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-03 18:35:10 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-04 11:20:39 +0100 |
commit | c43d133e5233415260afbed78f7cda8b4dec680c (patch) | |
tree | 927314ae44a30780c27762e5526eceab1642b41d /examples | |
parent | 2fccbb4f693cbd0eafaea17ff8daf904ee7358c5 (diff) |
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
Pick-to: 5.15 6.2 6.3
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>
Diffstat (limited to 'examples')
-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 f90eb06bd..8f331c598 100644 --- a/examples/tutorials/alarms/CMakeLists.txt +++ b/examples/tutorials/alarms/CMakeLists.txt @@ -33,16 +33,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 14fc29a86..4e75fa526 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 000000000..4fbf17b7b --- /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 ae9ac9078..270febb21 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> |