aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/snippets/qmltc/CMakeLists.txt1
-rw-r--r--src/qml/doc/snippets/qmltc/myApp.qml2
-rw-r--r--src/qml/doc/src/cmake/qt_add_qml_module.qdoc11
3 files changed, 10 insertions, 4 deletions
diff --git a/src/qml/doc/snippets/qmltc/CMakeLists.txt b/src/qml/doc/snippets/qmltc/CMakeLists.txt
index b6f24e8684..4be5a96528 100644
--- a/src/qml/doc/snippets/qmltc/CMakeLists.txt
+++ b/src/qml/doc/snippets/qmltc/CMakeLists.txt
@@ -45,7 +45,6 @@ target_compile_definitions(${application_name} PRIVATE
#! [qmltc-add-qml-module]
# Make the application into a proper QML module:
qt6_add_qml_module(${application_name}
- VERSION 1.0
URI QmltcExample
AUTO_RESOURCE_PREFIX
QML_FILES ${application_qml_files}
diff --git a/src/qml/doc/snippets/qmltc/myApp.qml b/src/qml/doc/snippets/qmltc/myApp.qml
index f4f9aa2f78..5fef927210 100644
--- a/src/qml/doc/snippets/qmltc/myApp.qml
+++ b/src/qml/doc/snippets/qmltc/myApp.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
-import QmltcExample 1.0 // application's own QML module
+import QmltcExample // application's own QML module
Rectangle {
id: window
diff --git a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc
index fc0ad59d51..e12b3a6f24 100644
--- a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc
+++ b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc
@@ -18,7 +18,7 @@
qt_add_qml_module(
target
URI uri
- VERSION version
+ [VERSION version]
[PAST_MAJOR_VERSIONS ...]
[STATIC | SHARED]
[PLUGIN_TARGET plugin_target]
@@ -363,7 +363,9 @@ alphanumeric or dot characters. Other QML modules may use this name in
\l{Module Definition qmldir Files}{qmldir} file. The \c URI is also used to
form the \e{target path} by replacing dots with forward slashes.
-A QML module must also define a \c VERSION in the form \c{Major.Minor}, where
+\section2 Versions
+
+A QML module can also define a \c VERSION in the form \c{Major.Minor}, where
both \c Major and \c Minor must be integers. An additional \c{.Patch}
component may be appended, but will be ignored. A list of earlier major
versions the module provides types for can also optionally be given after the
@@ -373,6 +375,11 @@ in-depth discussion of the module URI and version numbering,
\l{Registering past major versions} for registering past major versions, and
\l{Keeping module versions in sync} for keeping module versions in sync.
+If you don't need versions you should omit the \c VERSION argument. It defaults
+to the highest possible version. Internal versioning of QML modules has some
+fundamental flaws. You should use an external package management mechanism to
+manage different versions of your QML modules.
+
\section2 Adding sources and resources to the module
\c SOURCES specifies a list of non-QML sources to be added to the backing