From 33349e3fce9f05ff5f4ca1427751edd9b9929e82 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 21 Sep 2020 13:37:08 +0200 Subject: Fix a bunch of qdoc warnings from QList types For documentation purposes, we treat QList, QByteArrayList, and QStringList as simple classes, whereas reality is a bit more complicated. We conditionally change the declaration of the types for qdoc runs, and need to be consistent to avoid a flood of warnings from clang when building documentation. Change-Id: I22d529079e10f8fd3d93edc771e5f05729fa925f Reviewed-by: Paul Wicking --- src/corelib/tools/qcontainerfwd.h | 5 +++++ src/corelib/tools/qlist.h | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qcontainerfwd.h b/src/corelib/tools/qcontainerfwd.h index 46c2801b00..575cd1def9 100644 --- a/src/corelib/tools/qcontainerfwd.h +++ b/src/corelib/tools/qcontainerfwd.h @@ -61,8 +61,13 @@ template class QStack; template class QVarLengthArray; template class QList; template using QVector = QList; +#ifndef Q_CLANG_QDOC using QStringList = QList; using QByteArrayList = QList; +#else +class QStringList; +class QByteArrayList; +#endif class QMetaType; class QVariant; diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 5bdc993b67..3f621e71fb 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -302,9 +302,15 @@ public: QList &fill(parameter_type t, qsizetype size = -1); +#ifndef Q_QDOC using QListSpecialMethods::contains; using QListSpecialMethods::indexOf; using QListSpecialMethods::lastIndexOf; +#else + qsizetype indexOf(const T &t, qsizetype from = 0) const noexcept; + qsizetype lastIndexOf(const T &t, qsizetype from = -1) const noexcept; + bool contains(const T &t) const noexcept; +#endif qsizetype count(const T &t) const noexcept { -- cgit v1.2.3