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
committerFabian Kosmale <fabian.kosmale@qt.io>2021-09-29 13:39:41 +0200
commitabb9d7d793b900cfc75812e495b99cfdf6ee98bf (patch)
tree1f2f6d67b53700ef29813d6da3c294730e2e502e /src/qml/doc/src/qmlfunctions.qdoc
parent5c17d32f5b17cad3c20d151a948072ba78f9604c (diff)
QML_ELEMENT: Document CMake approach
Pick-to: 6.2 Change-Id: I593a79078abf953dda6789f318e0a530aaa5c7c5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
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 f6660cddce..52bf1f3f4a 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: