Fix qdoc warnings in QtDBus

And remove the limitation to 8 types from the documentation.

Change-Id: I92c67368e53d69fd851886c621f3f894f638bae9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Volker Hilsheimer 2020-10-20 21:04:23 +02:00
parent b6cd3bca28
commit 58060e7b6b
4 changed files with 20 additions and 19 deletions

View File

@ -268,7 +268,7 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d)
*/ */
/*! /*!
\fn template<typename T> T qdbus_cast(const QDBusArgument &arg, T*) \fn template<typename T> T qdbus_cast(const QDBusArgument &arg)
\relates QDBusArgument \relates QDBusArgument
\since 4.2 \since 4.2
@ -901,8 +901,8 @@ void QDBusArgument::endArray()
Opens a new D-Bus map suitable for Opens a new D-Bus map suitable for
appending elements. Maps are containers that associate one entry appending elements. Maps are containers that associate one entry
(the key) to another (the value), such as Qt's QMap or QHash. The (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 ids of the map's key and value meta types must be passed in \a keyMetaType
and \a vid respectively. and \a valueMetaType respectively.
This function is used usually in \c{operator<<} streaming This function is used usually in \c{operator<<} streaming
operators, as in the following example: operators, as in the following example:

View File

@ -308,8 +308,9 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other)
\sa QDBusPendingReply::isFinished() \sa QDBusPendingReply::isFinished()
*/ */
/*! /*!
\fn template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> bool QDBusPendingReply<T1, T2, T3, T4, T5, T6, T7, T8>::isFinished() const \fn template <typename... Types> bool QDBusPendingReply<Types...>::isFinished() const
Returns \c true if the pending call has finished processing and the Returns \c true if the pending call has finished processing and the
reply has been received. If this function returns \c true, the reply has been received. If this function returns \c true, the
@ -338,7 +339,7 @@ void QDBusPendingCall::waitForFinished()
} }
/*! /*!
\fn template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> bool QDBusPendingReply<T1, T2, T3, T4, T5, T6, T7, T8>::isValid() const \fn template <typename... Types> bool QDBusPendingReply<Types...>::isValid() const
Returns \c true if the reply contains a normal reply message, false Returns \c true if the reply contains a normal reply message, false
if it contains anything else. if it contains anything else.
@ -355,7 +356,7 @@ bool QDBusPendingCall::isValid() const
} }
/*! /*!
\fn template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> bool QDBusPendingReply<T1, T2, T3, T4, T5, T6, T7, T8>::isError() const \fn template <typename... Types> bool QDBusPendingReply<Types...>::isError() const
Returns \c true if the reply contains an error message, false if it Returns \c true if the reply contains an error message, false if it
contains a normal method reply. contains a normal method reply.
@ -372,7 +373,7 @@ bool QDBusPendingCall::isError() const
} }
/*! /*!
\fn template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> QDBusError QDBusPendingReply<T1, T2, T3, T4, T5, T6, T7, T8>::error() const \fn template <typename... Types> QDBusError QDBusPendingReply<Types...>::error() const
Retrieves the error content of the reply message, if it has Retrieves the error content of the reply message, if it has
finished processing. If the reply message has not finished finished processing. If the reply message has not finished
@ -393,7 +394,7 @@ QDBusError QDBusPendingCall::error() const
} }
/*! /*!
\fn template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> QDBusMessage QDBusPendingReply<T1, T2, T3, T4, T5, T6, T7, T8>::reply() const \fn template <typename... Types> QDBusMessage QDBusPendingReply<Types...>::reply() const
Retrieves the reply message received for the asynchronous call Retrieves the reply message received for the asynchronous call
that was sent, if it has finished processing. If the pending 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 \since 4.6
Creates a QDBusPendingCall object based on the error condition Creates a QDBusPendingCall object based on the error condition
\a error. The resulting pending call object will be in the \a error. The resulting pending call object will be in the
"finished" state and QDBusPendingReply<T1, T2, T3, T4, T5, T6, T7, T8>::isError() will return true. "finished" state and QDBusPendingReply<Types...>::isError() will return true.
\sa fromCompletedCall() \sa fromCompletedCall()
*/ */

View File

@ -53,16 +53,15 @@
\brief The QDBusPendingReply class contains the reply to an asynchronous method call. \brief The QDBusPendingReply class contains the reply to an asynchronous method call.
The QDBusPendingReply is a template class with up to 8 template The QDBusPendingReply is a variadic template class. The template parameters
parameters. Those parameters are the types that will be used to are the types that will be used to extract the contents of the reply's data.
extract the contents of the reply's data.
This class is similar in functionality to QDBusReply, but with two This class is similar in functionality to QDBusReply, but with two
important differences: important differences:
\list \list
\li QDBusReply accepts exactly one return type, whereas \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 \li QDBusReply only works on already completed replies, whereas
QDBusPendingReply allows one to wait for replies from pending QDBusPendingReply allows one to wait for replies from pending
calls calls
@ -199,9 +198,9 @@
*/ */
/*! /*!
\fn template<typename... Types> T1 QDBusPendingReply<Types...>::value() const \fn template<typename... Types> typename Select<0>::Type QDBusPendingReply<Types...>::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 first template parameter of this class). This is equivalent to
calling argumentAt<0>(). calling argumentAt<0>().
@ -212,14 +211,14 @@
calling thread to block until the reply is processed. calling thread to block until the reply is processed.
If the reply is an error reply, this function returns a default-constructed 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(). reliably determine whether the message was an error, use isError().
*/ */
/*! /*!
\fn template<typename... Types> QDBusPendingReply<Types...>::operator T1() const \fn template<typename... Types> QDBusPendingReply<Types...>::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 first template parameter of this class). This is equivalent to
calling argumentAt<0>(). calling argumentAt<0>().
@ -230,7 +229,7 @@
calling thread to block until the reply is processed. calling thread to block until the reply is processed.
If the reply is an error reply, this function returns a default-constructed 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(). reliably determine whether the message was an error, use isError().
*/ */

View File

@ -120,6 +120,7 @@ public:
#if defined(Q_CLANG_QDOC) #if defined(Q_CLANG_QDOC)
bool isFinished() const; bool isFinished() const;
void waitForFinished(); void waitForFinished();
QVariant argumentAt(int index) const;
bool isValid() const; bool isValid() const;
bool isError() const; bool isError() const;