From bdacf2b290e9d341ffc5d96e7bcc696ef3b7add7 Mon Sep 17 00:00:00 2001 From: Samuel Mira Date: Mon, 7 Mar 2022 18:50:08 +0200 Subject: Fix missing main.qml in examples These examples use resources files with qml files inside but the resource files were added in the project sources. That prevented the app to find and use the resource files. To fix the issue the resources were added using qt6_add_resources macro. Note that adding the cmake flag set(CMAKE_AUTORCC ON) would also work, but the qt6_add_resources macro is more consistent with the rest of the examples. Fixes: QTBUG-101518 Pick-to: 6.3 Change-Id: I5fb2481d5576683171a2292bdc35e417ee6d8fab Reviewed-by: Piotr Srebrny Reviewed-by: Assam Boudjelthia --- .../multimedia/video/mediaplayer/CMakeLists.txt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'examples/multimedia/video/mediaplayer/CMakeLists.txt') diff --git a/examples/multimedia/video/mediaplayer/CMakeLists.txt b/examples/multimedia/video/mediaplayer/CMakeLists.txt index f9e29d1fd..1c70197af 100644 --- a/examples/multimedia/video/mediaplayer/CMakeLists.txt +++ b/examples/multimedia/video/mediaplayer/CMakeLists.txt @@ -30,16 +30,31 @@ find_package(Qt6 REQUIRED COMPONENTS Core Quick QuickControls2 Svg) set(PROJECT_SOURCES main.cpp - qml.qrc ) qt_add_executable(mediaplayer ${PROJECT_SOURCES} ) +set(resource_files + "main.qml" + "PlaybackControl.qml" + "MetadataInfo.qml" + "AudioControl.qml" + "PlaybackSeekControl.qml" + "PlaybackRateControl.qml" + "PlayerMenuBar.qml" + "TracksInfo.qml" + "Mute_Icon.svg" + "Speaker_Icon.svg" +) + qt6_add_resources(mediaplayer "mediaplayer" - PREFIX "/" - FILES "Mute_Icon.svg" "Speaker_Icon.svg") + PREFIX + "/" + FILES + ${resource_files} +) target_compile_definitions(mediaplayer PRIVATE $<$,$>:QT_QML_DEBUG>) -- cgit v1.2.3