From a332322de95f25ca3228102d80d6a92b73b6177d Mon Sep 17 00:00:00 2001 From: Keith Gardner Date: Fri, 28 Mar 2014 21:45:33 -0500 Subject: 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 Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9 Reviewed-by: Oswald Buddenhagen --- src/testlib/qtest.h | 6 ++++++ src/testlib/qtestcase.cpp | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'src/testlib') 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 #include #include +#include #include #include @@ -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 -- cgit v1.2.3