diff options
author | Kai Koehne <kai.koehne@qt.io> | 2020-06-22 10:26:12 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2020-06-23 17:44:07 +0200 |
commit | 21dd7daa61a839bff6ff49ebb1ed23137542b1f4 (patch) | |
tree | fb4bcfd70706135091606ff418b618268bbd3b73 /src/qml/doc/src | |
parent | 3a95dd4df359750254eab4f46b69d1133b071b72 (diff) |
Document how to use CMake for Qt Qml
Task-number: QTBUG-73058
Change-Id: Ic27cfdf76b8f77c9834baaeaf449434bf5f28416
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r-- | src/qml/doc/src/qtqml-cpp.qdoc | 12 | ||||
-rw-r--r-- | src/qml/doc/src/qtqml.qdoc | 33 |
2 files changed, 20 insertions, 25 deletions
diff --git a/src/qml/doc/src/qtqml-cpp.qdoc b/src/qml/doc/src/qtqml-cpp.qdoc index 2c4d2a5ade..89c14cd82e 100644 --- a/src/qml/doc/src/qtqml-cpp.qdoc +++ b/src/qml/doc/src/qtqml-cpp.qdoc @@ -31,18 +31,6 @@ \qtvariable qml \brief The C++ API provided by the Qt QML module. -To include the definitions of the module's classes, use the -following directive: - -\snippet code/doc_src_qtqml.cpp 0 - -\if !defined(qtforpython) -To link against the module, add this line to your \l qmake \c -.pro file: - -\snippet code/doc_src_qtqml.pro 0 -\endif - For more information on the Qt QML module, see the \l{Qt QML} module documentation. */ diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc index 205cbc147d..5a1b59acdd 100644 --- a/src/qml/doc/src/qtqml.qdoc +++ b/src/qml/doc/src/qtqml.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -46,14 +46,9 @@ For those new to QML and Qt Quick, please see \l{QML Applications} for an introduction to writing QML applications. -\section1 Getting Started +\section1 Using the Module -To include the definitions of the module's classes, use the -following directive: - -\code -#include <QtQml> -\endcode +\section2 QML API The QML types in Qt QML are available through the \c QtQml import. To use the types, add the following import statement to your .qml file: @@ -62,13 +57,25 @@ types, add the following import statement to your .qml file: import QtQml 2.\1 \endqml +\section2 C++ API + +Using the \l{Qt QML 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 CMake and 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_qtqml.cmake 0 + +See also the \l{Build with CMake} overview. + +\section3 Building with qmake -To link against the module, add this line to your \l qmake \c -.pro file: +To configure the module for building with qmake, add the module as a value of the QT variable in the project's .pro file: -\code -QT += qml -\endcode +\snippet code/doc_src_qtqml.pro 0 \section1 QML and QML Types |