diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qml/doc/src/cppintegration/definetypes.qdoc | 4 | ||||
| -rw-r--r-- | src/qml/doc/src/qmlfunctions.qdoc | 54 | ||||
| -rw-r--r-- | src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h | 2 |
3 files changed, 51 insertions, 9 deletions
diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc index 1e31dc5e90..1701d2766d 100644 --- a/src/qml/doc/src/cppintegration/definetypes.qdoc +++ b/src/qml/doc/src/cppintegration/definetypes.qdoc @@ -88,7 +88,7 @@ using either the class name or an explicitly given name as QML type name. The minor version(s) will be derived from any revisions attached to properties, methods, or signals. The default minor version is \c 0. You can explicitly restrict the type to be available only from specific minor versions by adding -the \c QML_ADDED_IN_MINOR_VERSION() macro to the class declaration. Clients can +the \c QML_ADDED_IN_VERSION() macro to the class declaration. Clients can import suitable versions of the namespace in order to use the type. For example, suppose there is a \c Message class with \c author and @@ -414,7 +414,7 @@ available when \c MyTypes version 1.1 or higher is imported. Imports of \c MyTypes version 1.0 remain unaffected. For the same reason, new types introduced in later versions should be tagged -with the QML_ADDED_IN_MINOR_VERSION macro. +with the QML_ADDED_IN_VERSION macro. This feature of the language allows for behavioural changes to be made without breaking existing applications. Consequently QML module authors diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 2ffa189e54..d2df31355c 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -92,7 +92,7 @@ \include {qualified-class-name.qdocinc} {class name must be qualified} \sa {Choosing the Correct Integration Method Between C++ and QML}, QML_NAMED_ELEMENT(), - Q_REVISION(), QML_ADDED_IN_MINOR_VERSION() + Q_REVISION(), QML_ADDED_IN_VERSION() */ /*! @@ -340,13 +340,33 @@ */ /*! + \macro QML_ADDED_IN_VERSION(MAJOR, MINOR) + \relates QQmlEngine + + Declares that the enclosing type or namespace was added in the specified + \a{MAJOR}.\a{MINOR} version. The version is assumed to be in line with any + revisions given by \l Q_REVISION() macros on methods, slots, or signals, + and any REVISION() attributes on properties declared with \l Q_PROPERTY(). + + \l QML_ADDED_IN_VERSION() only takes effect if the type or namespace is + available in QML, by having a \l QML_ELEMENT, \l QML_NAMED_ELEMENT(), + \l QML_ANONYMOUS, or \l QML_INTERFACE macro. + + If the QML module the type belongs to is imported with a lower version than + the one determined this way, the QML type is invisible. + + \sa QML_ELEMENT, QML_NAMED_ELEMENT +*/ + +/*! \macro QML_ADDED_IN_MINOR_VERSION(VERSION) \relates QQmlEngine + \deprecated [6.7] Use QML_ADDED_IN_VERSION and specify the full version Declares that the enclosing type or namespace was added in the specified minor \a VERSION, relative to the module major version. The minor version is assumed to be in line with any revisions given by \l Q_REVISION() macros on methods, - slots, or signals, and any REVISION tags on properties declared with + slots, or signals, and any REVISION() attributes on properties declared with \l Q_PROPERTY(). \l QML_ADDED_IN_MINOR_VERSION() only takes effect if the type or namespace is @@ -356,17 +376,37 @@ If the QML module the type belongs to is imported with a lower version than the one determined this way, the QML type is invisible. - \sa QML_ELEMENT, QML_NAMED_ELEMENT() + \sa QML_ADDED_IN_VERSION, QML_ELEMENT, QML_NAMED_ELEMENT +*/ + +/*! + \macro QML_REMOVED_IN_VERSION(MAJOR, MINOR) + \relates QQmlEngine + + Declares that the enclosing type or namespace was removed in the specified + \a{MAJOR}.\a{MINOR} version. This is primarily useful when replacing the + implementation of a QML type. If a corresponding \l QML_ADDED_IN_VERSION() + is present on a different type or namespace of the same QML name, then the + removed type is used when importing versions of the module lower than + \a{MAJOR}.\a{MINOR}, and the added type is used when importing + versions of the module greater or equal \a{MAJOR}.\a{MINOR}. + + \l QML_REMOVED_IN_VERSION() only takes effect if type or namespace is + available in QML, by having a \l QML_ELEMENT, \l QML_NAMED_ELEMENT(), + \l QML_ANONYMOUS, or \l QML_INTERFACE macro. + + \sa QML_ELEMENT, QML_NAMED_ELEMENT */ /*! \macro QML_REMOVED_IN_MINOR_VERSION(VERSION) \relates QQmlEngine + \deprecated [6.7] Use QML_REMOVED_IN_VERSION and specify the full version Declares that the enclosing type or namespace was removed in the specified minor \a VERSION, relative to the module major version. This is primarily useful when replacing the implementation of a QML type. If a corresponding - \l QML_ADDED_IN_MINOR_VERSION() is present on a different type or namespace of + \l QML_ADDED_IN_VERSION() is present on a different type or namespace of the same QML name, then the removed type is used when importing versions of the module lower than \a VERSION, and the added type is used when importing versions of the module greater or equal \a VERSION. @@ -375,7 +415,7 @@ available in QML, by having a \l QML_ELEMENT, \l QML_NAMED_ELEMENT(), \l QML_ANONYMOUS, or \l QML_INTERFACE macro. - \sa QML_ELEMENT, QML_NAMED_ELEMENT() + \sa QML_REMOVED_IN_VERSION, QML_ELEMENT, QML_NAMED_ELEMENT */ /*! @@ -400,7 +440,7 @@ \note Keeping multiple \l{PAST_MAJOR_VERSIONS} around is computationally expensive. - \sa QML_ELEMENT, QML_ADDED_IN_MINOR_VERSION + \sa QML_ELEMENT, QML_ADDED_IN_VERSION */ /*! @@ -486,6 +526,7 @@ Declares that any \l QML_ELEMENT, \l QML_NAMED_ELEMENT(), \l QML_ANONYMOUS, \l QML_INTERFACE, \l QML_UNCREATABLE(), \l QML_SINGLETON, + \l QML_ADDED_IN_VERSION(), \l QML_REMOVED_IN_VERSION(), \l QML_ADDED_IN_MINOR_VERSION(), \l QML_REMOVED_IN_MINOR_VERSION(), \l QML_ATTACHED(), \l QML_EXTENDED(), or \l QML_EXTENDED_NAMESPACE() macros in the enclosing C++ type do not apply to the enclosing type but instead to @@ -513,6 +554,7 @@ Declares that any \l QML_ELEMENT, \l QML_NAMED_ELEMENT(), \l QML_ANONYMOUS, \l QML_INTERFACE, \l QML_UNCREATABLE(), \l QML_SINGLETON, + \l QML_ADDED_IN_VERSION(), \l QML_REMOVED_IN_VERSION(), \l QML_ADDED_IN_MINOR_VERSION(), or \l QML_REMOVED_IN_MINOR_VERSION() macros in the enclosing C++ namespace do not apply to the enclosing type but instead to \a FOREIGN_NAMESPACE. The enclosing namespace still needs to be diff --git a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h index a4def6be54..1de11ed48f 100644 --- a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h +++ b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h @@ -12,7 +12,7 @@ class TableModel : public QAbstractTableModel { Q_OBJECT QML_ELEMENT - QML_ADDED_IN_MINOR_VERSION(1) + QML_ADDED_IN_VERSION(1, 1) public: int rowCount(const QModelIndex & = QModelIndex()) const override |
