diff options
author | Andreas Eliasson <andreas.eliasson@qt.io> | 2022-02-17 13:09:54 +0100 |
---|---|---|
committer | Andreas Eliasson <andreas.eliasson@qt.io> | 2022-02-28 12:39:55 +0100 |
commit | 354e4e867acaa93e661769b2a78c146e181ba47f (patch) | |
tree | 2ffc95b5706ae01a12142160f6c60c97c6cfed1b /doc | |
parent | 95603e09c9b7e552239044c4ce7d79ec1bc7467d (diff) | |
download | qtbase-354e4e867acaa93e661769b2a78c146e181ba47f.tar.gz |
Doc: Add \include snippets with optional parameters
There are many different wordings for how to use the module across the
module landing pages. The goal here is to provide consistent wording
and code formatting, which can be used across all landing pages.
The style and wording is based on what has been implemented in the
Qt CoAP module landing page.
This is the syntax in a qdoc file:
\include {module-use.qdoc} {<snippet-id>} {<argument1>}
Inside qdocinc, you can then get the value of the argument1 using the
parameter \1.
Task-number: QTBUG-100369
Change-Id: Ib25e509e119008157e69db629eb011e5a9074022
Pick-to: 6.3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/global/includes/module-use.qdocinc | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/doc/global/includes/module-use.qdocinc b/doc/global/includes/module-use.qdocinc index 8f00e1dcaa..12dbffe8bc 100644 --- a/doc/global/includes/module-use.qdocinc +++ b/doc/global/includes/module-use.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -41,6 +41,20 @@ //! [using qt module] +//! [using the c++ api] + Using a Qt module requires linking against the module library, either + directly or through other dependencies. Several build tools have dedicated + support for this, including \l{CMake Documentation}{CMake} and \l{qmake}. +//! [using the c++ api] + +//! [using the qml api] + The QML types of the module are available through the \c \1 import. To use + the types, add the following import statement to your .qml file: + + \qml + import \1 + \endqml +//! [using the qml api] //! [building with qmake] @@ -50,3 +64,24 @@ of the \c QT variable in the project's .pro file: //! [building with qmake] + +//! [building_with_qmake] + To configure the module for building with qmake, add the module as a value + of the \c QT variable in the project's .pro file: + + \code + QT += \1 + \endcode +//! [building_with_qmake] + +//! [building with cmake] + Use the \c {find_package()} command to locate the needed module component + in the \c {Qt6} package: + + \code + find_package(Qt6 REQUIRED COMPONENTS \1) + target_link_libraries(mytarget PRIVATE Qt6::\1) + \endcode + + For more details, see the \l {Build with CMake} overview. +//! [building with cmake] |