From 52d761e60ade70f08c01d24e2b6a4dd2165d2a4a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 15 Jan 2018 15:57:12 +0100 Subject: [PATCH] doc: Fix remaining clang parsing errors in QtTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update also corrects all the remaining qdoc warnings in the mnodule. Change-Id: I1cea2cb1dd515d075a1e49a52ca78fc407c3a324 Reviewed-by: Topi Reiniƶ --- src/testlib/qabstractitemmodeltester.cpp | 28 ++++++------ src/testlib/qbenchmarkperfevents.cpp | 4 +- src/testlib/qsignalspy.h | 5 ++- src/testlib/qsignalspy.qdoc | 2 +- src/testlib/qtest_gui.h | 6 +-- src/testlib/qtestcase.qdoc | 55 +++++++++++++++++++++++- src/testlib/qtesttouch.h | 8 ++-- 7 files changed, 81 insertions(+), 27 deletions(-) diff --git a/src/testlib/qabstractitemmodeltester.cpp b/src/testlib/qabstractitemmodeltester.cpp index ef985007b1..18ae14be3a 100644 --- a/src/testlib/qabstractitemmodeltester.cpp +++ b/src/testlib/qabstractitemmodeltester.cpp @@ -172,13 +172,13 @@ private: This enumeration specifies how QAbstractItemModelTester should report a failure when it tests a QAbstractItemModel subclass. - \value FailureReportingMode::QtTest The failures will be reported through + \value QtTest The failures will be reported through QtTest's logging mechanism. - \value FailureReportingMode::Warning The failures will be reported as + \value Warning The failures will be reported as warning messages in the \c{qt.modeltest} logging category. - \value FailureReportingMode::Fatal A failure will cause immediate and + \value Fatal A failure will cause immediate and abnormal program termination. The reason for the failure will be reported using \c{qFatal()}. */ @@ -296,7 +296,7 @@ void QAbstractItemModelTesterPrivate::runAllTests() data(); } -/*! +/* nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. */ @@ -322,7 +322,7 @@ void QAbstractItemModelTesterPrivate::nonDestructiveBasicTest() model->roleNames(); } -/*! +/* Tests model's implementation of QAbstractItemModel::rowCount(), columnCount() and hasChildren(). @@ -364,7 +364,7 @@ void QAbstractItemModelTesterPrivate::rowAndColumnCount() // rowCount() / columnCount() are tested more extensively in checkChildren() } -/*! +/* Tests model's implementation of QAbstractItemModel::hasIndex() */ void QAbstractItemModelTesterPrivate::hasIndex() @@ -388,7 +388,7 @@ void QAbstractItemModelTesterPrivate::hasIndex() // but this catches the big mistakes } -/*! +/* Tests model's implementation of QAbstractItemModel::index() */ void QAbstractItemModelTesterPrivate::index() @@ -411,7 +411,7 @@ void QAbstractItemModelTesterPrivate::index() // but this catches the big mistakes } -/*! +/* Tests model's implementation of QAbstractItemModel::parent() */ void QAbstractItemModelTesterPrivate::parent() @@ -461,7 +461,7 @@ void QAbstractItemModelTesterPrivate::parent() checkChildren(QModelIndex()); } -/*! +/* Called from the parent() test. A model that returns an index of parent X should also return X when asking @@ -560,7 +560,7 @@ void QAbstractItemModelTesterPrivate::checkChildren(const QModelIndex &parent, i } } -/*! +/* Tests model's implementation of QAbstractItemModel::data() */ void QAbstractItemModelTesterPrivate::data() @@ -612,7 +612,7 @@ void QAbstractItemModelTesterPrivate::data() return; } -/*! +/* Store what is about to be inserted to make sure it actually happens \sa rowsInserted() @@ -633,7 +633,7 @@ void QAbstractItemModelTesterPrivate::rowsAboutToBeInserted(const QModelIndex &p insert.push(c); } -/*! +/* Confirm that what was said was going to happen actually did \sa rowsAboutToBeInserted() @@ -685,7 +685,7 @@ void QAbstractItemModelTesterPrivate::layoutChanged() changing.clear(); } -/*! +/* Store what is about to be inserted to make sure it actually happens \sa rowsRemoved() @@ -706,7 +706,7 @@ void QAbstractItemModelTesterPrivate::rowsAboutToBeRemoved(const QModelIndex &pa remove.push(c); } -/*! +/* Confirm that what was said was going to happen actually did \sa rowsAboutToBeRemoved() diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp index d6db40ce52..91f0792338 100644 --- a/src/testlib/qbenchmarkperfevents.cpp +++ b/src/testlib/qbenchmarkperfevents.cpp @@ -106,7 +106,9 @@ static void initPerf() } } -/*! +// This class does not exist in the API so it's qdoc comment marker was removed. + +/* \class QBenchmarkPerfEvents \brief The Linux perf events benchmark backend diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h index d9a0f4496b..824dc6aaed 100644 --- a/src/testlib/qsignalspy.h +++ b/src/testlib/qsignalspy.h @@ -96,7 +96,8 @@ public: initArgs(mo->method(sigIndex), obj); } -#ifdef Q_QDOC +#ifdef Q_CLANG_QDOC + template QSignalSpy(const QObject *object, PointerToMemberFunction signal); #else template @@ -136,7 +137,7 @@ public: sig = signalMetaMethod.methodSignature(); initArgs(mo->method(sigIndex), obj); } -#endif // Q_QDOC +#endif // Q_CLANG_QDOC inline bool isValid() const { return !sig.isEmpty(); } inline QByteArray signal() const { return sig; } diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc index f5c8ad32b3..77affc9a4b 100644 --- a/src/testlib/qsignalspy.qdoc +++ b/src/testlib/qsignalspy.qdoc @@ -72,7 +72,7 @@ \snippet code/doc_src_qsignalspy.cpp 4 */ -/*! \fn QSignalSpy::QSignalSpy(const QObject *object, PointerToMemberFunction signal) +/*! \fn template QSignalSpy::QSignalSpy(const QObject *object, PointerToMemberFunction signal) \since 5.4 Constructs a new QSignalSpy that listens for emissions of the \a signal diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h index a4f217ae1f..e5101e6955 100644 --- a/src/testlib/qtest_gui.h +++ b/src/testlib/qtest_gui.h @@ -113,7 +113,7 @@ template<> inline char *toString(const QRegion ®ion) return qstrdup(result.constData()); } -#ifndef QT_NO_VECTOR2D +#if !defined(QT_NO_VECTOR2D) || defined(Q_CLANG_QDOC) template<> inline char *toString(const QVector2D &v) { QByteArray result = "QVector2D(" + QByteArray::number(double(v.x())) + ", " @@ -121,7 +121,7 @@ template<> inline char *toString(const QVector2D &v) return qstrdup(result.constData()); } #endif // !QT_NO_VECTOR2D -#ifndef QT_NO_VECTOR3D +#if !defined(QT_NO_VECTOR3D) || defined(Q_CLANG_QDOC) template<> inline char *toString(const QVector3D &v) { QByteArray result = "QVector3D(" + QByteArray::number(double(v.x())) + ", " @@ -129,7 +129,7 @@ template<> inline char *toString(const QVector3D &v) return qstrdup(result.constData()); } #endif // !QT_NO_VECTOR3D -#ifndef QT_NO_VECTOR4D +#if !defined(QT_NO_VECTOR4D) || defined(Q_CLANG_QDOC) template<> inline char *toString(const QVector4D &v) { QByteArray result = "QVector4D(" + QByteArray::number(double(v.x())) + ", " diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 24bb1c3a97..0fb1cc6a8a 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -877,7 +877,42 @@ */ /*! - \fn char *QTest::toString(const T &value) + \fn template char *QTest::toString(const QPair &pair) + \overload + \since 5.11 + Returns a textual representation of the \a pair. +*/ + +/*! + \fn template char *QTest::toString(const std::pair &pair) + \overload + \since 5.11 + Returns a textual representation of the \a pair. +*/ + +/*! + \fn char *QTest::toString(const QVector2D &v) + \overload + \since 5.11 + Returns a textual representation of the 2D vector \a v. +*/ + +/*! + \fn char *QTest::toString(const QVector3D &v) + \overload + \since 5.11 + Returns a textual representation of the 3D vector \a v. +*/ + +/*! + \fn char *QTest::toString(const QVector4D &v) + \overload + \since 5.11 + Returns a textual representation of the 4D vector \a v. +*/ + +/*! + \fn template char *QTest::toString(const T &value) Returns a textual representation of \a value. This function is used by \l QCOMPARE() to output verbose information in case of a test failure. @@ -927,6 +962,22 @@ Returns a string containing \c{nullptr}. */ +/*! + \fn char *QTest::toString(const QStringView &string) + \overload + \since 5.11 + + Returns a textual representation of the given \a string. +*/ + +/*! + \fn char *QTest::toString(const QUuid &uuid) + \overload + \since 5.11 + + Returns a textual representation of the given \a uuid. +*/ + /*! \fn char *QTest::toString(const QString &string) \overload @@ -1075,7 +1126,7 @@ \sa QTest::qSleep(), QSignalSpy::wait() */ -/*! \fn void QTest::qWaitFor(Functor predicate, int timeout) +/*! \fn template bool QTest::qWaitFor(Functor predicate, int timeout) Waits for \a timeout milliseconds or until the \a predicate returns true. diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h index bdb6d5b629..83ca83602e 100644 --- a/src/testlib/qtesttouch.h +++ b/src/testlib/qtesttouch.h @@ -205,13 +205,13 @@ private: QWindow *targetWindow; QTouchDevice *device; bool commitWhenDestroyed; -#ifdef QT_WIDGETS_LIB - friend QTouchEventSequence touchEvent(QWidget *, QTouchDevice*, bool); +#if defined(QT_WIDGETS_LIB) || defined(Q_CLANG_QDOC) + friend QTouchEventSequence touchEvent(QWidget *widget, QTouchDevice *device, bool autoCommit); #endif - friend QTouchEventSequence touchEvent(QWindow *, QTouchDevice*, bool); + friend QTouchEventSequence touchEvent(QWindow *window, QTouchDevice *device, bool autoCommit); }; -#ifdef QT_WIDGETS_LIB +#if defined(QT_WIDGETS_LIB) || defined(Q_CLANG_QDOC) inline QTouchEventSequence touchEvent(QWidget *widget, QTouchDevice *device,