summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp9
-rw-r--r--src/corelib/kernel/qobject.cpp31
2 files changed, 36 insertions, 4 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 4399349352..b581be821b 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1904,9 +1904,9 @@ int QMetaMethod::methodIndex() const
return QMetaMethodPrivate::get(this)->ownMethodIndex() + mobj->methodOffset();
}
+// This method has been around for a while, but the documentation was marked \internal until 5.1
/*!
- \internal
-
+ \since 5.1
Returns the method revision if one was
specified by Q_REVISION, otherwise returns 0.
*/
@@ -2550,7 +2550,7 @@ static QByteArray qualifiedName(const QMetaEnum &e)
A property has a name() and a type(), as well as various
attributes that specify its behavior: isReadable(), isWritable(),
- isDesignable(), isScriptable(), and isStored().
+ isDesignable(), isScriptable(), revision(), and isStored().
If the property is an enumeration, isEnumType() returns true; if the
property is an enumeration that is also a flag (i.e. its values
@@ -2994,8 +2994,9 @@ int QMetaProperty::notifySignalIndex() const
}
}
+// This method has been around for a while, but the documentation was marked \internal until 5.1
/*!
- \internal
+ \since 5.1
Returns the property revision if one was
specified by REVISION, otherwise returns 0.
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 583e580762..527a842d17 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4103,6 +4103,37 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
*/
/*!
+ \macro Q_REVISION
+ \relates QObject
+
+ Apply this macro to definitions of member functions to tag them with a
+ revision number in the meta-object system. The macro is written before
+ the return type, as shown in the following example:
+
+ \snippet qmetaobject-revision/window.h Window class with revision
+
+ This is useful when using the meta-object system to dynamically expose
+ objects to another API, as you can match the version expected by multiple
+ versions of the other API. Consider the following simplified example:
+
+ \snippet qmetaobject-revision/main.cpp Window class using revision
+
+ Using the same Window class as the previous example, the newProperty and
+ newMethod would only be exposed in this code when the expected version is
+ 1 or greater.
+
+ Since all methods are considered to be in revision 0 if untagged, a tag
+ of Q_REVISION(0) is invalid and ignored.
+
+ This tag is not used by the meta-object system itself. Currently this is only
+ used by the QtQml module.
+
+ For a more generic string tag, see \l QMetaMethod::tag()
+
+ \sa QMetaMethod::revision()
+*/
+
+/*!
\macro Q_SET_OBJECT_NAME(Object)
\relates QObject
\since 5.0