aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2020-12-02 13:00:31 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-04 13:28:29 +0000
commit0255c24582f2cf775aad2c2238af4227eab48e7a (patch)
treee0926fc1007d604f053f18593cc15e9e44216b94 /src/quick
parentcec01bda2e803063682658b14813589ca98f17e8 (diff)
Document how to use CMake for Qt Quick
Task-number: QTBUG-73058 Change-Id: Ie72c1f4331ad05f31d9a646730133c97c4b15790 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit c8b108ca76e29d5c1b55468a9659eef80a6afa86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/doc/qtquick.qdocconf4
-rw-r--r--src/quick/doc/snippets/code/doc_src_qtquick.cmake4
-rw-r--r--src/quick/doc/src/qtquick.qdoc34
3 files changed, 41 insertions, 1 deletions
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 6a55a65094..e23f038041 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -52,7 +52,9 @@ depends += \
qtwidgets \
qmake \
qtsql \
- qtshadertools
+ qtshadertools \
+ qmake \
+ qtcmake
headerdirs += ..\
../../quick \
diff --git a/src/quick/doc/snippets/code/doc_src_qtquick.cmake b/src/quick/doc/snippets/code/doc_src_qtquick.cmake
new file mode 100644
index 0000000000..f575b40acc
--- /dev/null
+++ b/src/quick/doc/snippets/code/doc_src_qtquick.cmake
@@ -0,0 +1,4 @@
+#! [0]
+find_package(Qt6 COMPONENTS Quick REQUIRED)
+target_link_libraries(mytarget PRIVATE Qt6::Quick)
+#! [0]
diff --git a/src/quick/doc/src/qtquick.qdoc b/src/quick/doc/src/qtquick.qdoc
index da370d7828..49bd7c5ac1 100644
--- a/src/quick/doc/src/qtquick.qdoc
+++ b/src/quick/doc/src/qtquick.qdoc
@@ -49,6 +49,40 @@ For those new to QML and Qt Quick, please see
\l{QML Applications}
for an introduction to writing QML applications.
+\section1 Using the Module
+
+\section2 QML API
+
+The QML types in Qt Quick are available through the \c QtQuick import. To use the
+types, add the following import statement to your .qml file:
+
+\qml
+import QtQml
+\endqml
+
+\section2 C++ API
+
+Using the \l{Qt Quick C++ Classes}{C++ API} 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}.
+
+\section3 Building with CMake
+
+Use the \c find_package() command to locate the needed module components in the
+Qt6 package:
+
+\snippet code/doc_src_qtquick.cmake 0
+
+See also the \l{Build with CMake} overview.
+
+\section3 Building with qmake
+
+To configure the module for building with qmake, add the module as a value of
+the QT variable in the project's .pro file:
+
+\snippet code/doc_src_qtquick.pro 0
+
\section1 Important Concepts in Qt Quick
Qt Quick provides everything needed to create a rich application with a fluid