diff options
author | Keith Gardner <kreios4004@gmail.com> | 2014-03-28 21:45:33 -0500 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-08-09 09:00:24 +0200 |
commit | a332322de95f25ca3228102d80d6a92b73b6177d (patch) | |
tree | 3c97b56f0b5e1c0f2b98011332a47ec8f523e143 /src/testlib | |
parent | 3750c677ee4cac5525f9c7be3978173037dd089d (diff) |
Long live QVersionNumber!
The class provides compare operators, stream operators, and hashing
functions. This class aims to be compatible with (but not restricted to)
the Semantic Versioning 2.0 standard (semver.org).
[ChangeLog][QtCore] Added QVersionNumber class
Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtest.h | 6 | ||||
-rw-r--r-- | src/testlib/qtestcase.cpp | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 7d2f3cea72..8a18ea7541 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -54,6 +54,7 @@ #include <QtCore/qobject.h> #include <QtCore/qvariant.h> #include <QtCore/qurl.h> +#include <QtCore/qversionnumber.h> #include <QtCore/qpoint.h> #include <QtCore/qsize.h> @@ -171,6 +172,11 @@ template<> inline char *toString(const QVariant &v) return qstrdup(vstring.constData()); } +template<> inline char *toString(const QVersionNumber &version) +{ + return toString(version.toString()); +} + template<> inline bool qCompare(QString const &t1, QLatin1String const &t2, const char *actual, const char *expected, const char *file, int line) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 703e547f6b..739d341233 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1034,6 +1034,13 @@ QT_BEGIN_NAMESPACE Returns a textual representation of the given \a variant. */ +/*! + \fn char *QTest::toString(const QVersionNumber &version) + \overload + + Returns a textual representation of the given \a version. +*/ + /*! \fn void QTest::qWait(int ms) Waits for \a ms milliseconds. While waiting, events will be processed and |