From c8b108ca76e29d5c1b55468a9659eef80a6afa86 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 2 Dec 2020 13:00:31 +0100 Subject: Document how to use CMake for Qt Quick Task-number: QTBUG-73058 Pick-to: 6.0 Change-Id: Ie72c1f4331ad05f31d9a646730133c97c4b15790 Reviewed-by: Paul Wicking --- src/quick/doc/qtquick.qdocconf | 4 ++- src/quick/doc/snippets/code/doc_src_qtquick.cmake | 4 +++ src/quick/doc/src/qtquick.qdoc | 34 +++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/quick/doc/snippets/code/doc_src_qtquick.cmake (limited to 'src/quick') 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 -- cgit v1.2.3