From 81d8319276f26d399bdff47b49bd69b19bd86c5a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 10 Oct 2018 15:54:07 +0200 Subject: doc: Fix all clang parse errors in QtBase during PCH build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Topi Reiniƶ Reviewed-by: Martin Smith --- src/corelib/global/qfloat16.h | 2 -- src/corelib/io/qprocess.h | 2 +- src/corelib/kernel/qmetatype.h | 4 ++- src/corelib/kernel/qvariant.h | 4 ++- src/corelib/plugin/qfactoryinterface.h | 3 +- src/corelib/serialization/qjsonvalue.h | 2 -- src/corelib/thread/qresultstore.cpp | 15 +++++++++ src/corelib/thread/qresultstore.h | 2 -- src/corelib/tools/qbytearraylist.h | 6 ++-- src/dbus/qdbusargument.cpp | 2 +- src/dbus/qdbusargument.h | 12 ++------ src/dbus/qdbusconnection.h | 2 -- src/dbus/qdbuspendingcall.cpp | 12 ++++---- src/dbus/qdbuspendingcall.h | 2 +- src/dbus/qdbuspendingreply.cpp | 29 ++++++++---------- src/dbus/qdbuspendingreply.h | 3 -- src/dbus/qdbusreply.cpp | 2 +- src/dbus/qdbusreply.h | 4 --- src/dbus/qdbusutil.cpp | 30 +++++++++--------- src/gui/accessible/qaccessible.h | 2 ++ src/gui/opengl/qopenglfunctions.h | 18 ----------- src/gui/opengl/qopenglshaderprogram.h | 7 ----- src/gui/text/qabstracttextdocumentlayout.h | 2 ++ src/network/kernel/qhostinfo.cpp | 29 ++++++------------ src/network/kernel/qhostinfo.h | 7 ++--- src/opengl/qgl.h | 16 ---------- src/opengl/qglshaderprogram.h | 11 ------- src/widgets/dialogs/qmessagebox.h | 4 +-- src/widgets/graphicsview/qgraphicsitem.h | 2 ++ src/widgets/graphicsview/qgraphicslayout.h | 2 ++ src/widgets/graphicsview/qgraphicslayoutitem.h | 2 ++ src/widgets/widgets/qmenu.cpp | 42 +++++--------------------- src/widgets/widgets/qmenu.h | 4 --- src/widgets/widgets/qtoolbar.cpp | 38 +++++------------------ src/widgets/widgets/qtoolbar.h | 8 ++--- 35 files changed, 106 insertions(+), 226 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 QVariantList; typedef QMap QVariantMap; typedef QHash QVariantHash; -#ifndef Q_CLANG_QDOC +#ifdef Q_CLANG_QDOC +class QByteArrayList; +#else typedef QList 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() && __cplusplus >= 201703L #include +#elif defined(Q_CLANG_QDOC) +namespace std { template 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() && __cplusplus >= 201703L) +#if QT_HAS_INCLUDE() && __cplusplus >= 201703L template static inline QVariant fromStdVariant(const std::variant &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::const_iterator()), m_vectorIndex(0) { } ResultIteratorBase::ResultIteratorBase(QMap::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 QByteArrayListIterator; typedef QMutableListIterator QMutableByteArrayListIterator; -#ifndef Q_QDOC +#ifndef Q_CLANG_QDOC typedef QList QByteArrayList; namespace QtPrivate { @@ -58,13 +58,13 @@ namespace QtPrivate { } #endif -#ifdef Q_QDOC +#ifdef Q_CLANG_QDOC class QByteArrayList : public QList #else template <> struct QListSpecialMethods #endif { -#ifndef Q_QDOC +#ifndef Q_CLANG_QDOC protected: ~QListSpecialMethods() {} #endif diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index a33c4f8363..2d1373006d 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -267,7 +267,7 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d) */ /*! - \fn qdbus_cast(const QDBusArgument &arg) + \fn template T qdbus_cast(const QDBusArgument &arg, T*) \relates QDBusArgument \since 4.2 diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index a6d4e9cd25..ac650d5f62 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -158,22 +158,14 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QDBusArgument) QT_BEGIN_NAMESPACE -template inline T qdbus_cast(const QDBusArgument &arg -#ifndef Q_QDOC -, T * = nullptr -#endif - ) +template inline T qdbus_cast(const QDBusArgument &arg, T * = nullptr) { T item; arg >> item; return item; } -template inline T qdbus_cast(const QVariant &v -#ifndef Q_QDOC -, T * = nullptr -#endif - ) +template inline T qdbus_cast(const QVariant &v, T * = nullptr) { int id = v.userType(); if (id == qMetaTypeId()) diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h index ca7adfaaeb..3711981f78 100644 --- a/src/dbus/qdbusconnection.h +++ b/src/dbus/qdbusconnection.h @@ -122,9 +122,7 @@ public: SubPath = 0x1 // Reserved = 0xff000000 }; -#ifndef Q_QDOC Q_DECLARE_FLAGS(VirtualObjectRegisterOptions, VirtualObjectRegisterOption) -#endif enum ConnectionCapability { UnixFileDescriptorPassing = 0x0001 diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 2a31dd950a..4d0131afff 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -311,7 +311,7 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other) \sa QDBusPendingReply::isFinished() */ /*! - \fn bool QDBusPendingReply::isFinished() const + \fn template bool QDBusPendingReply::isFinished() const Returns \c true if the pending call has finished processing and the reply has been received. If this function returns \c true, the @@ -340,7 +340,7 @@ void QDBusPendingCall::waitForFinished() } /*! - \fn bool QDBusPendingReply::isValid() const + \fn template bool QDBusPendingReply::isValid() const Returns \c true if the reply contains a normal reply message, false if it contains anything else. @@ -357,7 +357,7 @@ bool QDBusPendingCall::isValid() const } /*! - \fn bool QDBusPendingReply::isError() const + \fn template bool QDBusPendingReply::isError() const Returns \c true if the reply contains an error message, false if it contains a normal method reply. @@ -374,7 +374,7 @@ bool QDBusPendingCall::isError() const } /*! - \fn QDBusError QDBusPendingReply::error() const + \fn template QDBusError QDBusPendingReply::error() const Retrieves the error content of the reply message, if it has finished processing. If the reply message has not finished @@ -395,7 +395,7 @@ QDBusError QDBusPendingCall::error() const } /*! - \fn QDBusMessage QDBusPendingReply::reply() const + \fn template QDBusMessage QDBusPendingReply::reply() const Retrieves the reply message received for the asynchronous call that was sent, if it has finished processing. If the pending call @@ -445,7 +445,7 @@ bool QDBusPendingCall::setReplyCallback(QObject *target, const char *member) \since 4.6 Creates a QDBusPendingCall object based on the error condition \a error. The resulting pending call object will be in the - "finished" state and QDBusPendingReply::isError() will return true. + "finished" state and QDBusPendingReply::isError() will return true. \sa fromCompletedCall() */ diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h index ec8ba6c541..24b1d6a7ca 100644 --- a/src/dbus/qdbuspendingcall.h +++ b/src/dbus/qdbuspendingcall.h @@ -67,7 +67,7 @@ public: void swap(QDBusPendingCall &other) Q_DECL_NOTHROW { qSwap(d, other.d); } -#ifndef Q_QDOC +#ifndef Q_CLANG_QDOC // pretend that they aren't here bool isFinished() const; void waitForFinished(); diff --git a/src/dbus/qdbuspendingreply.cpp b/src/dbus/qdbuspendingreply.cpp index fef6f36432..6aec571563 100644 --- a/src/dbus/qdbuspendingreply.cpp +++ b/src/dbus/qdbuspendingreply.cpp @@ -94,7 +94,7 @@ */ /*! - \fn QDBusPendingReply::QDBusPendingReply() + \fn template QDBusPendingReply::QDBusPendingReply() Creates an empty QDBusPendingReply object. Without assigning a QDBusPendingCall object to this reply, QDBusPendingReply cannot do @@ -102,7 +102,7 @@ */ /*! - \fn QDBusPendingReply::QDBusPendingReply(const QDBusPendingReply &other) + \fn template QDBusPendingReply::QDBusPendingReply(const QDBusPendingReply &other) Creates a copy of the \a other QDBusPendingReply object. Just like QDBusPendingCall and QDBusPendingCallWatcher, this QDBusPendingReply @@ -111,7 +111,7 @@ */ /*! - \fn QDBusPendingReply::QDBusPendingReply(const QDBusPendingCall &call) + \fn template QDBusPendingReply::QDBusPendingReply(const QDBusPendingCall &call) Creates a QDBusPendingReply object that will take its contents from the \a call pending asynchronous call. This QDBusPendingReply object @@ -119,7 +119,7 @@ */ /*! - \fn QDBusPendingReply::QDBusPendingReply(const QDBusMessage &message) + \fn template QDBusPendingReply::QDBusPendingReply(const QDBusMessage &message) Creates a QDBusPendingReply object that will take its contents from the message \a message. In this case, this object will be already @@ -129,7 +129,7 @@ */ /*! - \fn QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingReply &other) + \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingReply &other) Makes a copy of \a other and drops the reference to the current pending call. If the current reference is to an unfinished pending @@ -139,7 +139,7 @@ */ /*! - \fn QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingCall &call) + \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingCall &call) Makes this object take its contents from the \a call pending call and drops the reference to the current pending call. If the @@ -149,7 +149,7 @@ */ /*! - \fn QDBusPendingReply &QDBusPendingReply::operator=(const QDBusMessage &message) + \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusMessage &message) Makes this object take its contents from the \a message message and drops the reference to the current pending call. If the @@ -171,7 +171,7 @@ */ /*! - \fn int QDBusPendingReply::count() const + \fn template int QDBusPendingReply::count() const Return the number of arguments the reply is supposed to have. This number matches the number of non-void template parameters in this @@ -183,7 +183,7 @@ */ /*! - \fn QVariant QDBusPendingReply::argumentAt(int index) const + \fn template QVariant QDBusPendingReply::argumentAt(int index) const Returns the argument at position \a index in the reply's contents. If the reply doesn't have that many elements, this @@ -198,12 +198,7 @@ */ /*! - \typedef QDBusPendingReply::T1 - \internal - */ - -/*! - \fn T1 QDBusPendingReply::value() const + \fn template T1 QDBusPendingReply::value() const Returns the first argument in this reply, cast to type \c T1 (the first template parameter of this class). This is equivalent to @@ -221,7 +216,7 @@ */ /*! - \fn QDBusPendingReply::operator T1() const + \fn template QDBusPendingReply::operator T1() const Returns the first argument in this reply, cast to type \c T1 (the first template parameter of this class). This is equivalent to @@ -239,7 +234,7 @@ */ /*! - \fn void QDBusPendingReply::waitForFinished() + \fn template void QDBusPendingReply::waitForFinished() Suspends the execution of the calling thread until the reply is received and processed. After this function returns, isFinished() diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index 4d2c3a7c5a..bc5cd92c84 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -108,10 +108,8 @@ namespace QDBusPendingReplyTypes { template <> struct NotVoid { typedef TypeIsVoid Type; }; } // namespace QDBusPendingReplyTypes -#ifndef Q_CLANG_QDOC template -#endif class QDBusPendingReply: #ifdef Q_CLANG_QDOC public QDBusPendingCall @@ -171,7 +169,6 @@ public: QDBusError error() const; QDBusMessage reply() const; - typedef QVariant T1; inline T1 value() const; inline operator T1() const; #else diff --git a/src/dbus/qdbusreply.cpp b/src/dbus/qdbusreply.cpp index ab361f1674..6abfaf174c 100644 --- a/src/dbus/qdbusreply.cpp +++ b/src/dbus/qdbusreply.cpp @@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE */ /*! - \fn template QDBusReply::QDBusReply(const QDBusPendingReply &reply) + \fn template QDBusReply::QDBusReply(const QDBusPendingReply &reply) Constructs a QDBusReply object from the pending reply message, \a reply. */ diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h index 177b6c6e89..869687ac85 100644 --- a/src/dbus/qdbusreply.h +++ b/src/dbus/qdbusreply.h @@ -82,14 +82,10 @@ public: other.waitForFinished(); return *this = other.reply(); } -#if defined(Q_CLANG_QDOC) - inline QDBusReply(const QDBusPendingReply &reply) { } -#else inline QDBusReply(const QDBusPendingReply &reply) { *this = static_cast(reply); } -#endif inline QDBusReply(const QDBusError &dbusError = QDBusError()) : m_error(dbusError), m_data(Type()) diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index 28341a71a8..dc94897ac4 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -331,8 +331,8 @@ namespace QDBusUtil /*! \internal - \fn bool QDBusUtil::isValidPartOfObjectPath(const QStringRef &part) - See QDBusUtil::isValidObjectPath + \fn bool isValidPartOfObjectPath(const QStringRef &part) + See isValidObjectPath */ bool isValidPartOfObjectPath(const QStringRef &part) { @@ -349,13 +349,13 @@ namespace QDBusUtil /*! \internal - \fn bool QDBusUtil::isValidPartOfObjectPath(const QString &part) + \fn bool isValidPartOfObjectPath(const QString &part) \overload */ /*! - \fn bool QDBusUtil::isValidInterfaceName(const QString &ifaceName) + \fn bool isValidInterfaceName(const QString &ifaceName) Returns \c true if this is \a ifaceName is a valid interface name. Valid interface names must: @@ -384,7 +384,7 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidUniqueConnectionName(const QStringRef &connName) + \fn bool isValidUniqueConnectionName(const QStringRef &connName) Returns \c true if \a connName is a valid unique connection name. Unique connection names start with a colon (":") and are followed by a list of dot-separated @@ -414,13 +414,13 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidUniqueConnectionName(const QString &connName) + \fn bool isValidUniqueConnectionName(const QString &connName) \overload */ /*! - \fn bool QDBusUtil::isValidBusName(const QString &busName) + \fn bool isValidBusName(const QString &busName) Returns \c true if \a busName is a valid bus name. A valid bus name is either a valid unique connection name or follows the rules: @@ -462,7 +462,7 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidMemberName(const QStringRef &memberName) + \fn bool isValidMemberName(const QStringRef &memberName) Returns \c true if \a memberName is a valid member name. A valid member name does not exceed 255 characters in length, is not empty, is composed only of ASCII letters, digits and underscores, but does not start with a digit. @@ -482,13 +482,13 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidMemberName(const QString &memberName) + \fn bool isValidMemberName(const QString &memberName) \overload */ /*! - \fn bool QDBusUtil::isValidErrorName(const QString &errorName) + \fn bool isValidErrorName(const QString &errorName) Returns \c true if \a errorName is a valid error name. Valid error names are valid interface names and vice-versa, so this function is actually an alias for isValidInterfaceName. */ @@ -498,7 +498,7 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidObjectPath(const QString &path) + \fn bool isValidObjectPath(const QString &path) Returns \c true if \a path is valid object path. Valid object paths follow the rules: @@ -529,7 +529,7 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidBasicType(int type) + \fn bool isValidBasicType(int type) Returns \c true if \a c is a valid, basic D-Bus type. */ bool isValidBasicType(int c) @@ -538,7 +538,7 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidFixedType(int type) + \fn bool isValidFixedType(int type) Returns \c true if \a c is a valid, fixed D-Bus type. */ bool isValidFixedType(int c) @@ -548,7 +548,7 @@ namespace QDBusUtil /*! - \fn bool QDBusUtil::isValidSignature(const QString &signature) + \fn bool isValidSignature(const QString &signature) Returns \c true if \a signature is a valid D-Bus type signature for one or more types. This function returns \c true if it can all of \a signature into valid, individual types and no characters remain in \a signature. @@ -569,7 +569,7 @@ namespace QDBusUtil } /*! - \fn bool QDBusUtil::isValidSingleSignature(const QString &signature) + \fn bool isValidSingleSignature(const QString &signature) Returns \c true if \a signature is a valid D-Bus type signature for exactly one full type. This function tries to convert the type signature into a D-Bus type and, if it succeeds and no characters remain in the signature, it returns \c true. diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 1309f17efd..e2163b06d0 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -966,8 +966,10 @@ protected: int m_lastColumn; }; +#ifndef Q_CLANG_QDOC #define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface" Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid) +#endif Q_GUI_EXPORT const char *qAccessibleRoleString(QAccessible::Role role); Q_GUI_EXPORT const char *qAccessibleEventString(QAccessible::Event event); diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index 00287b0665..4554291bbd 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -228,26 +228,8 @@ struct QOpenGLFunctionsPrivate; #undef glTexLevelParameteriv #if defined(Q_CLANG_QDOC) -#undef GLint -typedef int GLint; -#undef GLsizei -typedef int GLsizei; -#undef GLuint -typedef unsigned int GLuint; -#undef GLubyte -typedef unsigned int GLubyte; -#undef GLenum -typedef unsigned int GLenum; #undef GLbitfield typedef unsigned int GLbitfield; -#undef GLfloat -typedef float GLfloat; -#undef GLclampf -typedef float GLclampf; -#undef GLboolean -typedef bool GLboolean; -#undef GLvoid -typedef void GLvoid; #undef GLchar typedef char GLchar; #endif diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/gui/opengl/qopenglshaderprogram.h index bdd18c9d68..c79101fd4d 100644 --- a/src/gui/opengl/qopenglshaderprogram.h +++ b/src/gui/opengl/qopenglshaderprogram.h @@ -50,13 +50,6 @@ #include #include -#if defined(Q_CLANG_QDOC) -#undef GLint -typedef int GLint; -#undef GLfloat -typedef double GLfloat; -#endif - QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h index 8fea27f772..3371401420 100644 --- a/src/gui/text/qabstracttextdocumentlayout.h +++ b/src/gui/text/qabstracttextdocumentlayout.h @@ -143,7 +143,9 @@ public: virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0; }; +#ifndef Q_CLANG_QDOC Q_DECLARE_INTERFACE(QTextObjectInterface, "org.qt-project.Qt.QTextObjectInterface") +#endif QT_END_NAMESPACE diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 0973d0dd52..1c7a8da06d 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -299,25 +299,6 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, \since 5.10 */ -/*! - \fn template int QHostInfo::lookupHost(const QString &name, const QObject *receiver, PointerToMemberFunction function) - - \since 5.9 - - \overload - - Looks up the IP address(es) associated with host name \a name, and - returns an ID for the lookup. When the result of the lookup is - ready, the slot or signal \a function in \a receiver is called with - a QHostInfo argument. The QHostInfo object can then be inspected - to get the results of the lookup. - - \note There is no guarantee on the order the signals will be emitted - if you start multiple requests with lookupHost(). - - \sa abortHostLookup(), addresses(), error(), fromName() -*/ - /*! \fn template int QHostInfo::lookupHost(const QString &name, Functor functor) @@ -354,6 +335,16 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, thread of \a context. The context's thread must have a running Qt event loop. + Here is an alternative signature for the function: + \code + lookupHost(const QString &name, const QObject *receiver, PointerToMemberFunction function) + \endcode + + In this case, when the result of the lookup is ready, the slot or + signal \c{function} in \c{receiver} is called with a QHostInfo + argument. The QHostInfo object can then be inspected to get the + results of the lookup. + \note There is no guarantee on the order the signals will be emitted if you start multiple requests with lookupHost(). diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 75917a02a3..49871ad470 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -91,13 +91,10 @@ public: static QString localDomainName(); #ifdef Q_CLANG_QDOC - template - static int QHostInfo::lookupHost(const QString &name, const QObject *receiver, - PointerToMemberFunction function); template - static int QHostInfo::lookupHost(const QString &name, Functor functor); + static int lookupHost(const QString &name, Functor functor); template - static int QHostInfo::lookupHost(const QString &name, const QObject *context, Functor functor); + static int lookupHost(const QString &name, const QObject *context, Functor functor); #else // lookupHost to a QObject slot template diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index a1ba0485e0..f5accbeb3c 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -51,22 +51,6 @@ #include -#if defined(Q_CLANG_QDOC) -#undef GLint -typedef int GLint; -#undef GLuint -typedef unsigned int GLuint; -#undef GLenum -typedef unsigned int GLenum; -#undef GLclampf -typedef float GLclampf; -#undef GLsizei -typedef int GLsizei; -#undef GLboolean -typedef bool GLboolean; -#endif - - QT_BEGIN_NAMESPACE diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index dfdef44b54..3ce88197d2 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -46,17 +46,6 @@ #include #include -#if defined(Q_CLANG_QDOC) -#undef GLfloat -typedef double GLfloat; -#undef GLint -typedef int GLint; -#undef GLuint -typedef unsigned int GLuint; -#undef GLenum -typedef unsigned int GLenum; -#endif - QT_BEGIN_NAMESPACE diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h index 4b993a9e65..0a2edb1eee 100644 --- a/src/widgets/dialogs/qmessagebox.h +++ b/src/widgets/dialogs/qmessagebox.h @@ -284,9 +284,9 @@ public: Q_SIGNALS: void buttonClicked(QAbstractButton *button); -#ifdef Q_QDOC +#ifdef Q_CLANG_QDOC public Q_SLOTS: - int exec(); + int exec() override; #endif protected: diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h index c228e765d8..729176530d 100644 --- a/src/widgets/graphicsview/qgraphicsitem.h +++ b/src/widgets/graphicsview/qgraphicsitem.h @@ -487,7 +487,9 @@ private: }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsItem::GraphicsItemFlags) +#ifndef Q_CLANG_QDOC Q_DECLARE_INTERFACE(QGraphicsItem, "org.qt-project.Qt.QGraphicsItem") +#endif inline void QGraphicsItem::setPos(qreal ax, qreal ay) { setPos(QPointF(ax, ay)); } diff --git a/src/widgets/graphicsview/qgraphicslayout.h b/src/widgets/graphicsview/qgraphicslayout.h index 28b335ceaa..efcafa5e6a 100644 --- a/src/widgets/graphicsview/qgraphicslayout.h +++ b/src/widgets/graphicsview/qgraphicslayout.h @@ -83,7 +83,9 @@ private: friend class QGraphicsWidget; }; +#ifndef Q_CLANG_QDOC Q_DECLARE_INTERFACE(QGraphicsLayout, "org.qt-project.Qt.QGraphicsLayout") +#endif QT_END_NAMESPACE diff --git a/src/widgets/graphicsview/qgraphicslayoutitem.h b/src/widgets/graphicsview/qgraphicslayoutitem.h index 44f430034b..86a0a87361 100644 --- a/src/widgets/graphicsview/qgraphicslayoutitem.h +++ b/src/widgets/graphicsview/qgraphicslayoutitem.h @@ -116,7 +116,9 @@ private: friend class QGraphicsLayout; }; +#ifndef Q_CLANG_QDOC Q_DECLARE_INTERFACE(QGraphicsLayoutItem, "org.qt-project.Qt.QGraphicsLayoutItem") +#endif inline void QGraphicsLayoutItem::setMinimumSize(qreal aw, qreal ah) { setMinimumSize(QSizeF(aw, ah)); } diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index c79e88f094..bf1102434c 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1800,21 +1800,6 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch return action; } -/*!\fn template QAction *QMenu::addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0) - - \since 5.6 - - \overload - - This convenience function creates a new action with the text \a - text and an optional shortcut \a shortcut. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. The function adds the newly created - action to the menu's list of actions and returns it. - - QMenu takes ownership of the returned QAction. -*/ - /*!\fn template QAction *QMenu::addAction(const QString &text, Functor functor, const QKeySequence &shortcut = 0) \since 5.6 @@ -1839,25 +1824,11 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch This convenience function creates a new action with the text \a text and an optional shortcut \a shortcut. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. The function adds the newly created - action to the menu's list of actions and returns it. + \a functor. The functor can be a pointer to a member function of + the \a context object. The newly created action is added to the + menu's list of actions and a pointer to it is returned. - If \a context is destroyed, the functor will not be called. - - QMenu takes ownership of the returned QAction. -*/ - -/*!\fn template QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0) - - \since 5.6 - - \overload - - This convenience function creates a new action with an \a icon - and some \a text and an optional shortcut \a shortcut. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. The function adds the newly created - action to the menu's list of actions and returns it. + If the \a context object is destroyed, the functor will not be called. QMenu takes ownership of the returned QAction. */ @@ -1886,8 +1857,9 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch This convenience function creates a new action with an \a icon and some \a text and an optional shortcut \a shortcut. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. The function adds the newly created - action to the menu's list of actions and returns it. + \a functor. The \a functor can be a pointer to a member function + of the \a context object. The newly created action is added to the + menu's list of actions and a pointer to it is returned. If \a context is destroyed, the functor will not be called. diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index 628f818b5e..84ab9e027a 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -82,14 +82,10 @@ public: QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char* member, const QKeySequence &shortcut = 0); #ifdef Q_CLANG_QDOC - template - QAction *addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0); template QAction *addAction(const QString &text, Functor functor, const QKeySequence &shortcut = 0); template QAction *addAction(const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0); - template - QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0); template QAction *addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut = 0); template diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 4af71c126e..1cd30e4d0d 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -799,18 +799,6 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text, return action; } -/*!\fn template QAction *QToolBar::addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method) - - \since 5.6 - - \overload - - Creates a new action with the given \a text. This action is added to - the end of the toolbar. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. -*/ - /*!\fn template QAction *QToolBar::addAction(const QString &text, Functor functor) \since 5.6 @@ -829,24 +817,13 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text, \overload - Creates a new action with the given \a text. This action is added to - the end of the toolbar. The action's + Creates a new action with the given \a text. This action is added + to the end of the toolbar. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. - - If \a context is destroyed, the functor will not be called. -*/ - -/*!\fn template QAction *QToolBar::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method) - - \since 5.6 + \a functor. The \a functor can be a pointer to a member function + in the \a context object. - \overload - - Creates a new action with the given \a icon and \a text. This - action is added to the end of the toolbar. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. + If the \a context object is destroyed, the \a functor will not be called. */ /*!\fn template QAction *QToolBar::addAction(const QIcon &icon, const QString &text, Functor functor) @@ -870,9 +847,10 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text, Creates a new action with the given \a icon and \a text. This action is added to the end of the toolbar. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. + \a functor. The \a functor can be a pointer to a member function + of the \a context object. - If \a context is destroyed, the functor will not be called. + If the \a context object is destroyed, the \a functor will not be called. */ /*! diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h index 4ae83190d1..0c434e8d1d 100644 --- a/src/widgets/widgets/qtoolbar.h +++ b/src/widgets/widgets/qtoolbar.h @@ -99,15 +99,11 @@ public: QAction *addAction(const QString &text, const QObject *receiver, const char* member); QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char* member); -#ifdef Q_QDOC - template - QAction *addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method); +#ifdef Q_CLANG_QDOC template QAction *addAction(const QString &text, Functor functor); template QAction *addAction(const QString &text, const QObject *context, Functor functor); - template - QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method); template QAction *addAction(const QIcon &icon, const QString &text, Functor functor); template @@ -149,7 +145,7 @@ public: connect(result, &QAction::triggered, slot); return result; } -#endif // !Q_QDOC +#endif // !Q_CLANG_QDOC QAction *addSeparator(); QAction *insertSeparator(QAction *before); -- cgit v1.2.3