From 58060e7b6b7c22a9171ca73aec2d4914ce309c56 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 20 Oct 2020 21:04:23 +0200 Subject: Fix qdoc warnings in QtDBus And remove the limitation to 8 types from the documentation. Change-Id: I92c67368e53d69fd851886c621f3f894f638bae9 Reviewed-by: Thiago Macieira --- src/dbus/qdbusargument.cpp | 6 +++--- src/dbus/qdbuspendingcall.cpp | 13 +++++++------ src/dbus/qdbuspendingreply.cpp | 19 +++++++++---------- src/dbus/qdbuspendingreply.h | 1 + 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index 10baa5d907..26ecd543f1 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -268,7 +268,7 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d) */ /*! - \fn template T qdbus_cast(const QDBusArgument &arg, T*) + \fn template T qdbus_cast(const QDBusArgument &arg) \relates QDBusArgument \since 4.2 @@ -901,8 +901,8 @@ void QDBusArgument::endArray() Opens a new D-Bus map suitable for appending elements. Maps are containers that associate one entry (the key) to another (the value), such as Qt's QMap or QHash. The - ids of the map's key and value meta types must be passed in \a kid - and \a vid respectively. + ids of the map's key and value meta types must be passed in \a keyMetaType + and \a valueMetaType respectively. This function is used usually in \c{operator<<} streaming operators, as in the following example: diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 34f5f9fac3..74aa1629fa 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -308,8 +308,9 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other) \sa QDBusPendingReply::isFinished() */ + /*! - \fn template 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 @@ -338,7 +339,7 @@ void QDBusPendingCall::waitForFinished() } /*! - \fn template 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. @@ -355,7 +356,7 @@ bool QDBusPendingCall::isValid() const } /*! - \fn template 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. @@ -372,7 +373,7 @@ bool QDBusPendingCall::isError() const } /*! - \fn template 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 @@ -393,7 +394,7 @@ QDBusError QDBusPendingCall::error() const } /*! - \fn template 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 @@ -443,7 +444,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/qdbuspendingreply.cpp b/src/dbus/qdbuspendingreply.cpp index 7499938184..2eb2526160 100644 --- a/src/dbus/qdbuspendingreply.cpp +++ b/src/dbus/qdbuspendingreply.cpp @@ -53,16 +53,15 @@ \brief The QDBusPendingReply class contains the reply to an asynchronous method call. - The QDBusPendingReply is a template class with up to 8 template - parameters. Those parameters are the types that will be used to - extract the contents of the reply's data. + The QDBusPendingReply is a variadic template class. The template parameters + are the types that will be used to extract the contents of the reply's data. This class is similar in functionality to QDBusReply, but with two important differences: \list \li QDBusReply accepts exactly one return type, whereas - QDBusPendingReply can have from 1 to 8 types + QDBusPendingReply can have any number of types \li QDBusReply only works on already completed replies, whereas QDBusPendingReply allows one to wait for replies from pending calls @@ -199,9 +198,9 @@ */ /*! - \fn template T1 QDBusPendingReply::value() const + \fn template typename Select<0>::Type QDBusPendingReply::value() const - Returns the first argument in this reply, cast to type \c T1 (the + Returns the first argument in this reply, cast to type \c Types[0] (the first template parameter of this class). This is equivalent to calling argumentAt<0>(). @@ -212,14 +211,14 @@ calling thread to block until the reply is processed. If the reply is an error reply, this function returns a default-constructed - \c T1 object, which may be indistinguishable from a valid value. To + \c Types[0] object, which may be indistinguishable from a valid value. To reliably determine whether the message was an error, use isError(). */ /*! - \fn template QDBusPendingReply::operator T1() const + \fn template QDBusPendingReply::operator typename Select<0>::Type() const - Returns the first argument in this reply, cast to type \c T1 (the + Returns the first argument in this reply, cast to type \c Types[0] (the first template parameter of this class). This is equivalent to calling argumentAt<0>(). @@ -230,7 +229,7 @@ calling thread to block until the reply is processed. If the reply is an error reply, this function returns a default-constructed - \c T1 object, which may be indistinguishable from a valid value. To + \c Types[0] object, which may be indistinguishable from a valid value. To reliably determine whether the message was an error, use isError(). */ diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index a44c95e240..5cea314dd9 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -120,6 +120,7 @@ public: #if defined(Q_CLANG_QDOC) bool isFinished() const; void waitForFinished(); + QVariant argumentAt(int index) const; bool isValid() const; bool isError() const; -- cgit v1.2.3