From a0b6488969e73e0e5d219051b9e08907b30fc3ff Mon Sep 17 00:00:00 2001 From: Orkun Tokdemir Date: Thu, 1 Aug 2024 15:59:26 +0200 Subject: [PATCH] Doc: Improve qt_add_ui documentation * Remove links to `qt_add_ui` in the qt_add_ui documentation * Add links for `qt_wrap_ui` and `AUTOUIC` Task-number: QTBUG-126463 Change-Id: I73c8e406407e3f71bba40e1c41473a17a7f45222 Reviewed-by: Alexandru Croitor (cherry picked from commit 2e8d7c552df4ac0987d7756ed4de9f35bb4735cc) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/doc/src/cmake-macros.qdoc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/widgets/doc/src/cmake-macros.qdoc b/src/widgets/doc/src/cmake-macros.qdoc index 906a18b2b0d..3a2ec13b736 100644 --- a/src/widgets/doc/src/cmake-macros.qdoc +++ b/src/widgets/doc/src/cmake-macros.qdoc @@ -107,7 +107,7 @@ In the following snippet, the \c{mainwindow.cpp} file includes \snippet cmake-macros/examples.cpp qt6_add_ui_1 \c{CMakeLists.txt} is implemented as follows and it calls -\l{qt6_add_ui}{qt_add_ui} to add \c{ui_mainwindow.h} to the \c{myapp} target. +\c{qt_add_ui} to add \c{ui_mainwindow.h} to the \c{myapp} target. \snippet cmake-macros/examples.cmake qt6_add_ui_1 @@ -146,29 +146,30 @@ Both \c{ui_widget1.h} and \c{ui_widget2.h} are included with the same prefix In this case, the \c{INCLUDE_PREFIX} argument can be specified as \c{src/files} for both files in the above snippet. -\section1 When to prefer \l{qt6_add_ui}{qt_add_ui} over \c{AUTOUIC}? +\section1 When to prefer \c{qt_add_ui} over \c{AUTOUIC}? -\l{qt6_add_ui}{qt_add_ui} has some advantages over \c{AUTOUIC}: +\c{qt_add_ui} has some advantages over \l{CMake AUTOUIC Documentation}{AUTOUIC}: \list -\li \l{qt6_add_ui}{qt_add_ui} ensures that the \c{.ui} files are generated +\li \c{qt_add_ui} ensures that the \c{.ui} files are generated correctly during the first build, for the \c{Ninja} and \c{Ninja Multi-Config} generators. -\li \l{qt6_add_ui}{qt_add_ui} guarantees that the generated \c{.h} files are +\li \c{qt_add_ui} guarantees that the generated \c{.h} files are not leaked outside the build directory. -\li Since \l{qt6_add_ui}{qt_add_ui} does not scan source files, it provides a -faster build than \c{AUTOUIC}. +\li Since \c{qt_add_ui} does not scan source files, it provides a faster build +than \c{AUTOUIC}. \endlist -\section1 When to prefer \l{qt6_add_ui}{qt_add_ui} over \c{qt_wrap_ui}? +\section1 When to prefer \c{qt_add_ui} over \c{qt_wrap_ui}? -\l{qt6_add_ui}{qt_add_ui} has the \c{INCLUDE_PREFIX} argument, which can be used to +\c{qt_add_ui} has the \c{INCLUDE_PREFIX} argument, which can be used to specify the include prefix for the generated header files. -\note It is not recommended to use both \l{qt6_add_ui}{qt_add_ui} and -\c{AUTOUIC} for the same target. +\note It is not recommended to use both \c{qt_add_ui} and +\l{CMake AUTOUIC Documentation}{AUTOUIC} for the same target. +\sa {qt_wrap_ui} */