From 16ebb44a5f9258a6349370f05688a6fb4ff6fb6d Mon Sep 17 00:00:00 2001 From: Andreas Eliasson Date: Tue, 9 Jan 2024 10:45:26 +0100 Subject: [PATCH] Doc: Add CMake section about how to include .qrc files in a project The current docs only describes how to do this in qmake. Let's use a tab and add a CMake section. Fixes: QTBUG-120568 Pick-to: 6.6 6.5 Change-Id: I766e92818c3e20aad5498443aa107aa369089ad0 Reviewed-by: Mitch Curtis Reviewed-by: Paul Wicking (cherry picked from commit 37c2d3cda39fd9d013f594705eed9b57c865c075) Reviewed-by: Qt Cherry-pick Bot --- .../src/qtquickcontrols-configuration.qdoc | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/quickcontrols/doc/src/qtquickcontrols-configuration.qdoc b/src/quickcontrols/doc/src/qtquickcontrols-configuration.qdoc index bb341c7ad6..7cc61b5701 100644 --- a/src/quickcontrols/doc/src/qtquickcontrols-configuration.qdoc +++ b/src/quickcontrols/doc/src/qtquickcontrols-configuration.qdoc @@ -152,12 +152,39 @@ is possible to provide a different configuration file for different platforms and locales. See \l QFileSelector documentation for more details. - Finally, the \c .qrc file must be listed in the application's \c .pro file so that - the build system knows about it. For example: + Finally, the \c .qrc file must be listed in the application's build file. + For example: - \code - RESOURCES = application.qrc + \if defined(onlinedocs) + \tab {build-qt-app}{tab-cmake}{CMakeLists.txt (CMake)}{checked} + \tab {build-qt-app}{tab-qmake}{.pro (qmake)}{} + \tabcontent {tab-cmake} + \else + \section2 Using CMake + \endif + \badcode + set(CMAKE_AUTORCC ON) + qt_add_executable(my_app + application.qrc + main.cpp + ... + ) \endcode + \if defined(onlinedocs) + \endtabcontent + \tabcontent {tab-qmake} + \else + \section2 Using qmake + \endif + \badcode + RESOURCES = application.qrc + ... + \endcode + \if defined(onlinedocs) + \endtabcontent + \endif + + See also: \l {Build System Integration} \section1 Related Information