Doc: Fix template information for QVariant members

When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for of the members of `QVariant` is not in sync
with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: I9ec1a09091afbb17bc37bfc1dee8f738f01619e9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit is contained in:
Luca Di Sera 2023-11-03 15:27:37 +01:00
parent 482d11fdbe
commit 848e312052

View File

@ -2585,7 +2585,7 @@ QT_WARNING_POP
#endif
/*! \fn template<typename T> void QVariant::setValue(T &&value)
/*! \fn template<typename T, typename = std::enable_if_t<!std::is_same_v<std::decay_t<T>, QVariant>>> void QVariant::setValue(T &&value)
Stores a copy of \a value. If \c{T} is a type that QVariant
doesn't support, QMetaType is used to store the value. A compile
@ -2598,13 +2598,13 @@ QT_WARNING_POP
\sa value(), fromValue(), canConvert()
*/
/*! \fn template<typename T> void QVariant::setValue(const QVariant &value)
/*! \fn void QVariant::setValue(const QVariant &value)
Copies \a value over this QVariant. It is equivalent to simply
assigning \a value to this QVariant.
*/
/*! \fn template<typename T> void QVariant::setValue(QVariant &&value)
/*! \fn void QVariant::setValue(QVariant &&value)
Moves \a value over this QVariant. It is equivalent to simply
move assigning \a value to this QVariant.
@ -2650,7 +2650,7 @@ QT_WARNING_POP
\sa canView(), Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE()
*/
/*! \fn bool QVariant::canConvert() const
/*! \fn template<typename T> bool QVariant::canConvert() const
Returns \c true if the variant can be converted to the template type \c{T},
otherwise false.
@ -2666,7 +2666,7 @@ QT_WARNING_POP
\sa convert()
*/
/*! \fn bool QVariant::canView() const
/*! \fn template<typename T> bool QVariant::canView() const
Returns \c true if a mutable view of the template type \c{T} can be created on this variant,
otherwise \c false.
@ -2686,7 +2686,7 @@ QT_WARNING_POP
\sa setValue(), value()
*/
/*! \fn template<typename T> static QVariant QVariant::fromValue(T &&value)
/*! \fn template<typename T, if_rvalue<T> = true> static QVariant QVariant::fromValue(T &&value)
\since 6.6
\overload