From f64694647a9a3d54fa5ecdaf2570e8c7404271a6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 16 Jan 2020 11:33:41 +0100 Subject: moc: Extend revision markers to allow for major and minor version As we want Qt's own revisions to follow the Qt versioning scheme, we need to allow for the minor version to reset to 0 now. In order to facilitate this, we interpret the argument passed the current Q_REVISION macro as major version and allow for an optional minor version. Both are encoded it into the resulting revision number. Change-Id: I3519fe20233d473f34a24ec9589d045cdd162a12 Reviewed-by: Fawzi Mohamed Reviewed-by: Shawn Rutledge Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qobject.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/corelib/kernel/qobject.cpp') 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. -- cgit v1.2.3