diff options
author | Martin Smith <martin.smith@qt.io> | 2018-10-10 15:54:07 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2018-11-05 13:10:11 +0000 |
commit | 81d8319276f26d399bdff47b49bd69b19bd86c5a (patch) | |
tree | 39451f0f0e82d007897aa1b062c470caca3d9fda /src/corelib | |
parent | 8b7a4b8dd8ffd4c55fd013179242ecd42441d6a9 (diff) |
doc: Fix all clang parse errors in QtBase during PCH build
This update eliminates ALL parsing errors when clang parses the
Qt headers to build the precompiled header qdoc needs. These errors
are often cases where an old use of Q_QDOC no longer works because
clang sees the enclosed fake declarations as erroneous.
In a few cases, clang reported errors because two dummy function
declartations under the Q_CLANG_QDOC guard were indistinguishable,
so one of them was removed, and the documentation was patched
accordingly.
Using the macro Q_DECLARE_INTERFACE(...) causes clang to report errors
because the class parametewr is abstract. These uses of the macro are
not needed, so they are removed with #ifndef Q_CLANG_QDOC.
Some declarations of default GL types that had been provided for qdoc
were no longer needed, so they are removed.
Now there are some member function signatures in QDBusPendingReply
and QDBusPendingCall that have very long template clauses and qualifiers
in their signatures. These unwieldy signatures will be unnecessary in the
documentation and will look bad there, but for now they are correct. The
ultimate solution will be to add a metacommand to qdoc, something like
\simplify-signature to tell qdoc to generate the documentation for these
member functions without the long template caluses and qualifiers.
Change-Id: I012cf17a544fbba2ebc71002f31bdc865119bb8e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qfloat16.h | 2 | ||||
-rw-r--r-- | src/corelib/io/qprocess.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 4 | ||||
-rw-r--r-- | src/corelib/plugin/qfactoryinterface.h | 3 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonvalue.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qresultstore.cpp | 15 | ||||
-rw-r--r-- | src/corelib/thread/qresultstore.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qbytearraylist.h | 6 |
9 files changed, 27 insertions, 13 deletions
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index a8befd7adb..766ab319a4 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -67,11 +67,9 @@ QT_BEGIN_NAMESPACE class qfloat16 { public: -#ifndef Q_QDOC Q_DECL_CONSTEXPR inline qfloat16() Q_DECL_NOTHROW : b16(0) { } inline qfloat16(float f) Q_DECL_NOTHROW; inline operator float() const Q_DECL_NOTHROW; -#endif private: quint16 b16; diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index 474fc87de8..5e022e3a52 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE class QProcessPrivate; -#if !defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) +#if !defined(Q_OS_WIN) typedef qint64 Q_PID; #else QT_END_NAMESPACE diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 0bf430bb26..a47fbfe28d 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1977,7 +1977,9 @@ QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER) typedef QList<QVariant> QVariantList; typedef QMap<QString, QVariant> QVariantMap; typedef QHash<QString, QVariant> QVariantHash; -#ifndef Q_CLANG_QDOC +#ifdef Q_CLANG_QDOC +class QByteArrayList; +#else typedef QList<QByteArray> QByteArrayList; #endif diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index ff73c27b6e..f95502e75f 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -55,6 +55,8 @@ #if QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L #include <variant> +#elif defined(Q_CLANG_QDOC) +namespace std { template<typename...> struct variant; } #endif QT_BEGIN_NAMESPACE @@ -365,7 +367,7 @@ class Q_CORE_EXPORT QVariant static inline QVariant fromValue(const T &value) { return qVariantFromValue(value); } -#if defined(Q_CLANG_QDOC) || (QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L) +#if QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L template<typename... Types> static inline QVariant fromStdVariant(const std::variant<Types...> &value) { diff --git a/src/corelib/plugin/qfactoryinterface.h b/src/corelib/plugin/qfactoryinterface.h index f306460690..3aec4ddd55 100644 --- a/src/corelib/plugin/qfactoryinterface.h +++ b/src/corelib/plugin/qfactoryinterface.h @@ -52,8 +52,9 @@ struct Q_CORE_EXPORT QFactoryInterface virtual QStringList keys() const = 0; }; - +#ifndef Q_CLANG_QDOC Q_DECLARE_INTERFACE(QFactoryInterface, "org.qt-project.Qt.QFactoryInterface") +#endif QT_END_NAMESPACE diff --git a/src/corelib/serialization/qjsonvalue.h b/src/corelib/serialization/qjsonvalue.h index 16d2c0c14c..0339eb59f7 100644 --- a/src/corelib/serialization/qjsonvalue.h +++ b/src/corelib/serialization/qjsonvalue.h @@ -219,7 +219,6 @@ private: uint index : 31; }; -#ifndef Q_QDOC // ### Qt 6: Get rid of these fake pointer classes class QJsonValuePtr { @@ -244,7 +243,6 @@ public: QJsonValueRef& operator*() { return valueRef; } QJsonValueRef* operator->() { return &valueRef; } }; -#endif Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QJsonValue) diff --git a/src/corelib/thread/qresultstore.cpp b/src/corelib/thread/qresultstore.cpp index e0ce1b4b78..1b3bc20eca 100644 --- a/src/corelib/thread/qresultstore.cpp +++ b/src/corelib/thread/qresultstore.cpp @@ -43,6 +43,21 @@ QT_BEGIN_NAMESPACE namespace QtPrivate { +/*! + \class QtPrivate::ResultItem + \internal + */ + +/*! + \class QtPrivate::ResultIteratorBase + \internal + */ + +/*! + \class QtPrivate::ResultStoreBase + \internal + */ + ResultIteratorBase::ResultIteratorBase() : mapIterator(QMap<int, ResultItem>::const_iterator()), m_vectorIndex(0) { } ResultIteratorBase::ResultIteratorBase(QMap<int, ResultItem>::const_iterator _mapIterator, int _vectorIndex) diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h index 39f0a6d1bb..1f29e8d187 100644 --- a/src/corelib/thread/qresultstore.h +++ b/src/corelib/thread/qresultstore.h @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE either individually or in batches. */ -#ifndef Q_QDOC namespace QtPrivate { @@ -196,7 +195,6 @@ public: Q_DECLARE_TYPEINFO(QtPrivate::ResultItem, Q_PRIMITIVE_TYPE); -#endif //Q_QDOC QT_END_NAMESPACE diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h index ed014dd157..be94bc1d40 100644 --- a/src/corelib/tools/qbytearraylist.h +++ b/src/corelib/tools/qbytearraylist.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE typedef QListIterator<QByteArray> QByteArrayListIterator; typedef QMutableListIterator<QByteArray> QMutableByteArrayListIterator; -#ifndef Q_QDOC +#ifndef Q_CLANG_QDOC typedef QList<QByteArray> QByteArrayList; namespace QtPrivate { @@ -58,13 +58,13 @@ namespace QtPrivate { } #endif -#ifdef Q_QDOC +#ifdef Q_CLANG_QDOC class QByteArrayList : public QList<QByteArray> #else template <> struct QListSpecialMethods<QByteArray> #endif { -#ifndef Q_QDOC +#ifndef Q_CLANG_QDOC protected: ~QListSpecialMethods() {} #endif |