From 848e312052b4c62cc77a153fb4564d8723c8a3cd Mon Sep 17 00:00:00 2001 From: Luca Di Sera Date: Fri, 3 Nov 2023 15:27:37 +0100 Subject: [PATCH] Doc: Fix template information for QVariant members MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ƶ --- src/corelib/kernel/qvariant.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index f8a3747207f..cca00724170 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2585,7 +2585,7 @@ QT_WARNING_POP #endif -/*! \fn template void QVariant::setValue(T &&value) +/*! \fn template, 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 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 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 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 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 static QVariant QVariant::fromValue(T &&value) +/*! \fn template = true> static QVariant QVariant::fromValue(T &&value) \since 6.6 \overload