aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2018-09-09 14:56:48 +0200
committerTopi Reiniƶ <topi.reinio@qt.io>2018-09-14 10:23:29 +0000
commit940c06a4645cca190055a3987db8147b4e2de02c (patch)
tree0fb5e97b5cf24b42cf4d7b5740975b4dc5015a12
parentd7365a653fffe0a8b05f2f56715de01681e5203a (diff)
Doc: Use a macro to resolve the QML import version
QDoc now supports macros for its command parameters, as well as passing parameters to \code and \qml commands. Use these together with the new \QtMinorVersion macro to automate bumping the QML import versions within documentation. Task-number: QTBUG-67818 Change-Id: I8b5300749880421a0d7cdacc1b2c0f96b3b7ef67 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp18
-rw-r--r--src/imports/localstorage/plugin.cpp18
-rw-r--r--src/imports/models/plugin.cpp8
-rw-r--r--src/imports/window/plugin.cpp8
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp8
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc14
-rw-r--r--src/qml/doc/src/qtqml.qdoc9
-rw-r--r--src/qml/doc/src/statemachine.qdoc14
-rw-r--r--src/quick/doc/src/concepts/effects/particles.qdoc18
-rw-r--r--src/quick/doc/src/concepts/layouts/qtquicklayouts.qdoc8
-rw-r--r--src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc12
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc19
12 files changed, 81 insertions, 73 deletions
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index f5f38adb18..66d9e7ae46 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -224,16 +224,16 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
}
/*!
- \qmlmodule Qt.labs.folderlistmodel 2.12
+ \qmlmodule Qt.labs.folderlistmodel 2.\QtMinorVersion
\title Qt Labs FolderListModel QML Types
\ingroup qmlmodules
\brief The FolderListModel provides a model of the contents of a file system folder.
To use this module, import the module with the following line:
- \code
- import Qt.labs.folderlistmodel 2.12
- \endcode
+ \qml \QtMinorVersion
+ import Qt.labs.folderlistmodel 2.\1
+ \endqml
*/
@@ -251,7 +251,9 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
\e{Elements in the Qt.labs module are not guaranteed to remain compatible
in future versions.}
- \b{import Qt.labs.folderlistmodel 2.12}
+ \qml \QtMinorVersion
+ import Qt.labs.folderlistmodel 2.\1
+ \endqml
The \l folder property specifies the folder to access. Information about the
files and directories in the folder is supplied via the model's interface.
@@ -295,9 +297,9 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
The following example shows a FolderListModel being used to provide a list
of QML files in a \l ListView:
- \qml
- import QtQuick 2.0
- import Qt.labs.folderlistmodel 2.12
+ \qml \QtMinorVersion
+ import QtQuick 2.\1
+ import Qt.labs.folderlistmodel 2.\1
ListView {
width: 200; height: 400
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 15037b6a3a..bdf7294056 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -520,7 +520,7 @@ through the data.
/*!
- \qmlmodule QtQuick.LocalStorage 2.12
+ \qmlmodule QtQuick.LocalStorage 2.\QtMinorVersion
\title Qt Quick Local Storage QML Types
\ingroup qmlmodules
\brief Provides a JavaScript object singleton type for accessing a local
@@ -541,16 +541,16 @@ through the data.
To use the types in this module, import the module and call the
relevant functions using the \c LocalStorage type:
- \code
- import QtQuick.LocalStorage 2.0
- import QtQuick 2.0
+ \qml \QtMinorVersion
+ import QtQuick 2.\1
+ import QtQuick.LocalStorage 2.\1
Item {
Component.onCompleted: {
var db = LocalStorage.openDatabaseSync(...)
}
}
- \endcode
+ \endqml
These databases are user-specific and QML-specific, but accessible to all QML applications.
@@ -570,11 +570,13 @@ The \l{Qt Quick Examples - Local Storage}{SQL Local Storage example} demonstrate
using the Offline Storage API.
\section3 Open or Create a Database
-\code
-import QtQuick.LocalStorage 2.0 as Sql
+
+\qml \QtMinorVersion
+import QtQuick.LocalStorage 2.\1 as Sql
db = Sql.openDatabaseSync(identifier, version, description, estimated_size, callback(db))
-\endcode
+\endqml
+
The above code returns the database identified by \e identifier. If the database does not already exist, it
is created, and the function \e callback is called with the database as a parameter. \e identifier is the
name of the physical file (with or without full path) containing the database. \e description and
diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp
index e0ba2c07a4..2b19345f6b 100644
--- a/src/imports/models/plugin.cpp
+++ b/src/imports/models/plugin.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
/*!
- \qmlmodule QtQml.Models 2.12
+ \qmlmodule QtQml.Models 2.\QtMinorVersion
\title Qt QML Models QML Types
\ingroup qmlmodules
\brief Provides QML types for data models
@@ -55,9 +55,9 @@ QT_BEGIN_NAMESPACE
To use the types in this module, import the module with the following line:
- \code
- import QtQml.Models 2.12
- \endcode
+ \qml \QtMinorVersion
+ import QtQml.Models 2.\1
+ \endqml
Note that QtQml.Models module started at version 2.1 to match the version
of the parent module, \l{Qt QML}.
diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp
index e0af82c8ea..657b230fa2 100644
--- a/src/imports/window/plugin.cpp
+++ b/src/imports/window/plugin.cpp
@@ -44,7 +44,7 @@
QT_BEGIN_NAMESPACE
/*!
- \qmlmodule QtQuick.Window 2.12
+ \qmlmodule QtQuick.Window 2.\QtMinorVersion
\title Qt Quick Window QML Types
\ingroup qmlmodules
\brief Provides QML types for window management
@@ -53,9 +53,9 @@ QT_BEGIN_NAMESPACE
To use the types in this module, import the module with the following line:
- \code
- import QtQuick.Window 2.12
- \endcode
+ \qml \QtMinorVersion
+ import QtQuick.Window 2.\1
+ \endqml
*/
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index 8941b33045..470b419c1f 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -74,7 +74,7 @@ typedef QPair<int, int> QQuickXmlListRange;
#define XMLLISTMODEL_CLEAR_ID 0
/*!
- \qmlmodule QtQuick.XmlListModel 2.12
+ \qmlmodule QtQuick.XmlListModel 2.\QtMinorVersion
\title Qt Quick XmlListModel QML Types
\ingroup qmlmodules
\brief Provides QML types for creating models from XML data
@@ -83,9 +83,9 @@ typedef QPair<int, int> QQuickXmlListRange;
To use the types in this module, import the module with the following line:
- \code
- import QtQuick.XmlListModel 2.12
- \endcode
+ \qml \QtMinorVersion
+ import QtQuick.XmlListModel 2.\1
+ \endqml
*/
/*!
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index d38f592648..79bfdc7042 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\qmlmodule QtQml 2.12
+\qmlmodule QtQml 2.\QtMinorVersion
\title Qt QML QML Types
\ingroup qmlmodules
\brief List of QML types provided by the Qt QML module
@@ -43,19 +43,19 @@ The types provided by the \c QtQml module are only available in a QML document
if that document imports the \c QtQml namespace (or if the document imports the
\c QtQuick namespace, as noted below).
-The current version of the \c QtQml module is version 2.12, and thus it may be
-imported via the following statement:
+The current version of the \c QtQml module is version 2.\QtMinorVersion, and
+thus it may be imported via the following statement:
-\qml
-import QtQml 2.12
+\qml \QtMinorVersion
+import QtQml 2.\1
\endqml
Most clients will never need to use the \c QtQml import, as all of the types
are also provided by the \c QtQuick namespace which may be imported as
follows:
-\qml
-import QtQuick 2.12
+\qml \QtMinorVersion
+import QtQuick 2.\1
\endqml
See the \l{Qt Quick} module documentation for more information about the \c
diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc
index a964534fec..68d2b66950 100644
--- a/src/qml/doc/src/qtqml.qdoc
+++ b/src/qml/doc/src/qtqml.qdoc
@@ -55,11 +55,12 @@ following directive:
#include <QtQml>
\endcode
-The QML types in Qt QML are available through the \c QtQML import. To use the
+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:
-\code
-import QtQml 2.12
-\endcode
+
+\qml \QtMinorVersion
+import QtQml 2.\1
+\endqml
To link against the module, add this line to your \l qmake \c
diff --git a/src/qml/doc/src/statemachine.qdoc b/src/qml/doc/src/statemachine.qdoc
index 59170a223f..6986f1baa0 100644
--- a/src/qml/doc/src/statemachine.qdoc
+++ b/src/qml/doc/src/statemachine.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \qmlmodule QtQml.StateMachine 1.11
+ \qmlmodule QtQml.StateMachine 1.\QtMinorVersion
\title Declarative State Machine QML Types
\brief Provides QML types to create and execute state graphs.
@@ -68,9 +68,9 @@
\e{QtQml.StateMachine} \e{last}. This way, the \e{State} type is provided
by the Declarative State Machine Framework and not by \l{QtQuick}:
- \qml
- import QtQuick 2.0
- import QtQml.StateMachine 1.0
+ \qml \QtMinorVersion
+ import QtQuick 2.\1
+ import QtQml.StateMachine 1.\1
StateMachine {
State {
@@ -82,9 +82,9 @@
Alternatively, you can import \e{QtQml.StateMachine} into a separate
namespace to avoid any ambiguity with QtQuick's \e{State} item:
- \qml
- import QtQuick 2.0
- import QtQml.StateMachine 1.0 as DSM
+ \qml \QtMinorVersion
+ import QtQuick 2.\1
+ import QtQml.StateMachine 1.\1 as DSM
DSM.StateMachine {
DSM.State {
diff --git a/src/quick/doc/src/concepts/effects/particles.qdoc b/src/quick/doc/src/concepts/effects/particles.qdoc
index 452130a05b..0b87eb4529 100644
--- a/src/quick/doc/src/concepts/effects/particles.qdoc
+++ b/src/quick/doc/src/concepts/effects/particles.qdoc
@@ -26,15 +26,16 @@
****************************************************************************/
/*!
- \qmlmodule QtQuick.Particles 2.12
+ \qmlmodule QtQuick.Particles 2.\QtMinorVersion
\title Qt Quick Particles QML Types
\ingroup qmlmodules
\brief Provides QML types for particle effects
This QML module contains a particle system for Qt Quick. To use these types, import the module with the following line:
- \code
- import QtQuick.Particles 2.12
- \endcode
+
+ \qml \QtMinorVersion
+ import QtQuick.Particles 2.\1
+ \endqml
For a simple overview of how the system can be used, see \l{Using the Qt Quick Particle System}.
@@ -48,10 +49,11 @@
Documentation for all Particle System types can be found on the \l QtQuick.Particles module page.
- Note that to use types from the particles module, you will need to import the types with the following line:
- \code
- import QtQuick.Particles 2.12
- \endcode
+ To use the types from the particles module, import the module with the following line:
+
+ \qml \QtMinorVersion
+ import QtQuick.Particles 2.\1
+ \endqml
\section1 The ParticleSystem
This particle system contains four main types of QML types: ParticleSystem, Painters, Emitters and Affectors.
diff --git a/src/quick/doc/src/concepts/layouts/qtquicklayouts.qdoc b/src/quick/doc/src/concepts/layouts/qtquicklayouts.qdoc
index d82e35fb93..c33fc0cfa3 100644
--- a/src/quick/doc/src/concepts/layouts/qtquicklayouts.qdoc
+++ b/src/quick/doc/src/concepts/layouts/qtquicklayouts.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \qmlmodule QtQuick.Layouts 1.11
+ \qmlmodule QtQuick.Layouts 1.\QtMinorVersion
\title Qt Quick Layouts QML Types
\ingroup qmlmodules
\brief Provides QML types for arranging QML items in a user interface.
@@ -39,8 +39,8 @@
The QML types can be imported into your application using the
following import statement in your .qml file.
- \code
- import QtQuick.Layouts 1.11
- \endcode
+ \qml \QtMinorVersion
+ import QtQuick.Layouts 1.\1
+ \endqml
*/
diff --git a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc
index bac6ac8a52..f5599e404a 100644
--- a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc
+++ b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc
@@ -197,9 +197,9 @@ so. To explain why, let's take a look at a simplified example.
Suppose we were writing the UI for a settings page:
-\qml
- import QtQuick 2.12
- import QtQuick.Controls 2.12
+\qml \QtMinorVersion
+ import QtQuick 2.\1
+ import QtQuick.Controls 2.\1
Page {
Button {
@@ -296,9 +296,9 @@ into QML:
The QML then calls the C++ slot directly:
-\qml
- import QtQuick 2.12
- import QtQuick.Controls 2.12
+\qml \QtMinorVersion
+ import QtQuick 2.\1
+ import QtQuick.Controls 2.\1
Page {
Button {
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index 1a743b23e6..ddf90f88d9 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\qmlmodule QtQuick 2.12
+\qmlmodule QtQuick 2.\QtMinorVersion
\title Qt Quick QML Types
\ingroup qmlmodules
\brief Provides graphical QML types.
@@ -34,11 +34,11 @@
The \l{Qt Quick} module provides graphical primitive types. These types are only
available in a QML document if that document imports the \c QtQuick namespace.
-The current version of the \c QtQuick module is version 2.12, and thus it may be
-imported via the following statement:
+The current version of the \c QtQuick module is version \QtMinorVersion, and
+thus it may be imported via the following statement:
-\qml
-import QtQuick 2.12
+\qml \QtMinorVersion
+import QtQuick 2.\1
\endqml
Visit the \l {Qt Quick} module documentation for more
@@ -889,15 +889,16 @@ console.log(c + " " + d); // false true
*/
/*!
-\qmlmodule QtTest 1.11
+\qmlmodule QtTest 1.\QtMinorVersion
\title Qt Quick Test QML Types
\brief This module provides QML types to unit test your QML application
\ingroup qmlmodules
You can import this module using the following statement:
-\code
-import QtTest 1.11
-\endcode
+
+\qml \QtMinorVersion
+import QtTest 1.\1
+\endqml
For more information about how to use these types, see
\l{Qt Quick Test}.