diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-12-17 15:49:50 +0100 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-16 03:12:59 +0100 |
commit | ba7653fb74a288fbb0c7df3c24001b7170e087ae (patch) | |
tree | f3eea61c711d133460cf20f12f58beed50fd3fb9 /src/testlib/qtestcase.cpp | |
parent | 49057a1eab3d226d504db0e12e65e27fa9b42c2d (diff) |
qtest_widgets.h: add support for pretty-printing QSizePolicy
... in QCOMPAREs.
The implementation is hidden in a nested Internal namespace that retrieves
the strings without strdup()ing. That makes it easier to compose these
functions as there is no need to delete character arrays when using them.
The public interface (which qstrdup()s) is implemented on top of these.
[ChangeLog][QtTest] QCOMPARE now pretty-prints QSizePolicy{,::Policy,::ControlType{,s}}.
Change-Id: Ib03d969847e5a12474c71a7921366b400025f680
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 4e7ab18e9b..dc03968258 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -97,6 +97,11 @@ using QtMiscUtils::toHexUpper; See the \l{Qt Test Overview} for information about how to write unit tests. */ +/*! + \namespace QTest::Internal + \internal +*/ + /*! \macro QVERIFY(condition) \relates QTest @@ -1041,6 +1046,38 @@ using QtMiscUtils::toHexUpper; Returns a textual representation of the given \a variant. */ +/*! + \fn char *QTest::toString(QSizePolicy::ControlType ct) + \overload + \since 5.5 + + Returns a textual representation of control type \a ct. +*/ + +/*! + \fn char *QTest::toString(QSizePolicy::ControlTypes cts) + \overload + \since 5.5 + + Returns a textual representation of control types \a cts. +*/ + +/*! + \fn char *QTest::toString(QSizePolicy::Policy p) + \overload + \since 5.5 + + Returns a textual representation of policy \a p. +*/ + +/*! + \fn char *QTest::toString(QSizePolicy sp) + \overload + \since 5.5 + + Returns a textual representation of size policy \a sp. +*/ + /*! \fn void QTest::qWait(int ms) Waits for \a ms milliseconds. While waiting, events will be processed and |