diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/doc/snippets/code/doc_src_properties.cpp | 2 | ||||
-rw-r--r-- | src/corelib/doc/snippets/qmetaobject-revision/window.h | 4 | ||||
-rw-r--r-- | src/corelib/doc/src/objectmodel/properties.qdoc | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 11 | ||||
-rw-r--r-- | src/corelib/kernel/qtmetamacros.h | 4 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/corelib/doc/snippets/code/doc_src_properties.cpp b/src/corelib/doc/snippets/code/doc_src_properties.cpp index a67945bbcf..e026a47e23 100644 --- a/src/corelib/doc/snippets/code/doc_src_properties.cpp +++ b/src/corelib/doc/snippets/code/doc_src_properties.cpp @@ -54,7 +54,7 @@ Q_PROPERTY(type name MEMBER memberName [(READ getFunction | WRITE setFunction)]) [RESET resetFunction] [NOTIFY notifySignal] - [REVISION int] + [REVISION int | REVISION(int[, int])] [DESIGNABLE bool] [SCRIPTABLE bool] [STORED bool] diff --git a/src/corelib/doc/snippets/qmetaobject-revision/window.h b/src/corelib/doc/snippets/qmetaobject-revision/window.h index f93d253b6b..f519a6f2dc 100644 --- a/src/corelib/doc/snippets/qmetaobject-revision/window.h +++ b/src/corelib/doc/snippets/qmetaobject-revision/window.h @@ -58,7 +58,7 @@ class Window : public QWidget { Q_OBJECT Q_PROPERTY(int normalProperty READ normalProperty) - Q_PROPERTY(int newProperty READ newProperty REVISION 1) + Q_PROPERTY(int newProperty READ newProperty REVISION(2, 1)) public: Window(); @@ -66,7 +66,7 @@ public: int newProperty(); public slots: void normalMethod(); - Q_REVISION(1) void newMethod(); + Q_REVISION(2, 1) void newMethod(); }; //! [Window class with revision] diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc index 680e5598f0..abeb9b7a54 100644 --- a/src/corelib/doc/src/objectmodel/properties.qdoc +++ b/src/corelib/doc/src/objectmodel/properties.qdoc @@ -102,8 +102,8 @@ re-evaluated in QML, for example. Qt emits automatically that signal when needed for MEMBER properties that do not have an explicit setter. - \li A \c REVISION number is optional. If included, it defines - the property and its notifier signal to be used in a particular + \li A \c REVISION number or \c REVISION() macro is optional. If included, + it defines the property and its notifier signal to be used in a particular revision of the API (usually for exposure to QML). If not included, it defaults to 0. diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index c72383ff4a..d452b43ff6 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4674,10 +4674,15 @@ QDebug operator<<(QDebug dbg, const QObject *o) 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. + \c{2.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. + Since all methods are considered to be in revision \c{0} if untagged, a tag + of \c{Q_REVISION(0)}, or \c{Q_REVISION(0, 0)} is invalid and ignored. + + You can pass one or two integer parameters to \c{Q_REVISION}. If you pass + one, the parameter denotes the minor version and major version is + unspecified. If you pass two, the first parameter is the major version and + the second parameter is the minor version. This tag is not used by the meta-object system itself. Currently this is only used by the QtQml module. diff --git a/src/corelib/kernel/qtmetamacros.h b/src/corelib/kernel/qtmetamacros.h index 1d095c0d7c..2dcd6948aa 100644 --- a/src/corelib/kernel/qtmetamacros.h +++ b/src/corelib/kernel/qtmetamacros.h @@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE #define Q_PROPERTY(...) QT_ANNOTATE_CLASS(qt_property, __VA_ARGS__) #define Q_PRIVATE_PROPERTY(d, text) QT_ANNOTATE_CLASS2(qt_private_property, d, text) #ifndef Q_REVISION -# define Q_REVISION(v) +# define Q_REVISION(...) #endif #define Q_OVERRIDE(text) QT_ANNOTATE_CLASS(qt_override, text) #define QDOC_PROPERTY(text) QT_ANNOTATE_CLASS(qt_qdoc_property, text) @@ -211,7 +211,7 @@ private: \ #define Q_INTERFACES(x) Q_INTERFACES(x) #define Q_PROPERTY(text) Q_PROPERTY(text) #define Q_PRIVATE_PROPERTY(d, text) Q_PRIVATE_PROPERTY(d, text) -#define Q_REVISION(v) Q_REVISION(v) +#define Q_REVISION(...) Q_REVISION(__VA_ARGS__) #define Q_OVERRIDE(text) Q_OVERRIDE(text) #define Q_ENUMS(x) Q_ENUMS(x) #define Q_FLAGS(x) Q_FLAGS(x) |