aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/qmlfunctions.qdoc
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-08-26 15:47:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-29 16:30:55 +0000
commit8acaaef3180377b387cf5396e70b45e519649455 (patch)
tree11968e78665f36d0e8a1cba67395fbb6e056503a /src/qml/doc/src/qmlfunctions.qdoc
parent7ff1404a12f6bb58a78c1ca8747b493ff385b050 (diff)
QML_ELEMENT: Document CMake approach
Change-Id: I593a79078abf953dda6789f318e0a530aaa5c7c5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit abb9d7d793b900cfc75812e495b99cfdf6ee98bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/doc/src/qmlfunctions.qdoc')
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index c32eca84ee..e80bab778d 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -45,8 +45,8 @@
\endcode
You can use the build system to register the type in the type namespace
- \e {com.mycompany.qmlcomponents} with major version \c 1 by specifying the
- following in your project file:
+ \e {com.mycompany.qmlcomponents} with major version \c 1.
+ For qmake, specify the following in your project file:
\badcode
CONFIG += qmltypes
@@ -54,6 +54,15 @@
QML_IMPORT_MAJOR_VERSION = 1
\endcode
+ With CMake, you pass the URI and version to qt_add_qml_module
+
+ \badcode
+ qt6_add_qml_module(myapp
+ URI com.mycompany.qmlcomponents
+ VERSION 1.0
+ )
+ \endcode
+
Once registered, the type can be used in QML by importing the
same type namespace and version number: