From abb9d7d793b900cfc75812e495b99cfdf6ee98bf Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Thu, 26 Aug 2021 15:47:42 +0200 Subject: QML_ELEMENT: Document CMake approach Pick-to: 6.2 Change-Id: I593a79078abf953dda6789f318e0a530aaa5c7c5 Reviewed-by: Ulf Hermann --- src/qml/doc/src/qmlfunctions.qdoc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/qml/doc/src/qmlfunctions.qdoc') 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: -- cgit v1.2.3