Doc: Fix \fn template arguments for Qt Core

Upcoming changes to QDoc require accurate definition for
template arguments in \fn commands.

Task-number: QTBUG-118080
Change-Id: I64d50919bc6ffab61ef5ead553d1da99d63a9f21
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit is contained in:
Luca Di Sera 2023-11-29 17:41:53 +01:00
parent 7b84cd62b0
commit 60c2d72d96
19 changed files with 53 additions and 49 deletions

View File

@ -1099,7 +1099,7 @@ CHECK(strong, equivalent);
*/
/*!
\fn template <typename LeftInt, typename RightInt> Qt::compareThreeWay(LeftInt lhs, RightInt rhs)
\fn template <typename LeftInt, typename RightInt, Qt::if_integral<LeftInt, RightInt> = true> Qt::compareThreeWay(LeftInt lhs, RightInt rhs)
\since 6.7
\relates <QtCompare>
\overload
@ -1137,7 +1137,7 @@ CHECK(strong, equivalent);
*/
/*!
\fn template <typename LeftFloat, typename RightFloat> Qt::compareThreeWay(LeftFloat lhs, RightFloat rhs)
\fn template <typename LeftFloat, typename RightFloat, Qt::if_floating_point<LeftFloat, RightFloat> = true> Qt::compareThreeWay(LeftFloat lhs, RightFloat rhs)
\since 6.7
\relates <QtCompare>
\overload
@ -1176,7 +1176,7 @@ CHECK(strong, equivalent);
*/
/*!
\fn template <typename IntType, typename FloatType> Qt::compareThreeWay(IntType lhs, FloatType rhs)
\fn template <typename IntType, typename FloatType, Qt::if_integral_and_floating_point<IntType, FloatType> = true> Qt::compareThreeWay(IntType lhs, FloatType rhs)
\since 6.7
\relates <QtCompare>
\overload
@ -1196,7 +1196,7 @@ CHECK(strong, equivalent);
*/
/*!
\fn template <typename FloatType, typename IntType> Qt::compareThreeWay(FloatType lhs, IntType rhs)
\fn template <typename FloatType, typename IntType, Qt::if_integral_and_floating_point<IntType, FloatType> = true> Qt::compareThreeWay(FloatType lhs, IntType rhs)
\since 6.7
\relates <QtCompare>
\overload
@ -1216,7 +1216,7 @@ CHECK(strong, equivalent);
*/
/*!
\fn template <typename LeftType, typename RightType> Qt::compareThreeWay(const LeftType *lhs, const RightType *rhs)
\fn template <typename LeftType, typename RightType, Qt::if_compatible_pointers<LeftType, RightType> = true> Qt::compareThreeWay(const LeftType *lhs, const RightType *rhs)
\since 6.7
\relates <QtCompare>
\overload
@ -1232,7 +1232,7 @@ CHECK(strong, equivalent);
*/
/*!
\fn template <class Enum> Qt::compareThreeWay(Enum lhs, Enum rhs)
\fn template <class Enum, Qt::if_enum<Enum> = true> Qt::compareThreeWay(Enum lhs, Enum rhs)
\since 6.7
\relates <QtCompare>
\overload

View File

@ -765,7 +765,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
*/
/*!
\fn template <typename UInt, IfValidUInt<UInt> = true> void QRandomGenerator::fillRange(UInt *buffer, qsizetype count)
\fn template <typename UInt, QRandomGenerator::IfValidUInt<UInt> = true> void QRandomGenerator::fillRange(UInt *buffer, qsizetype count)
Generates \a count 32- or 64-bit quantities (depending on the type \c UInt)
and stores them in the buffer pointed by \a buffer. This is the most
@ -781,7 +781,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
*/
/*!
\fn template <typename UInt, size_t N, IfValidUInt<UInt> = true> void QRandomGenerator::fillRange(UInt (&buffer)[N])
\fn template <typename UInt, size_t N, QRandomGenerator::IfValidUInt<UInt> = true> void QRandomGenerator::fillRange(UInt (&buffer)[N])
Generates \c N 32- or 64-bit quantities (depending on the type \c UInt) and
stores them in the \a buffer array. This is the most efficient way to

View File

@ -212,7 +212,7 @@ void QPersistentModelIndexData::destroy(QPersistentModelIndexData *data)
*/
/*!
\fn template <typename Container, if_compatible_container<Container> = true> QModelRoleDataSpan::QModelRoleDataSpan(Container &c) noexcept
\fn template <typename Container, QModelRoleDataSpan::if_compatible_container<Container> = true> QModelRoleDataSpan::QModelRoleDataSpan(Container &c) noexcept
Constructs an QModelRoleDataSpan spanning over the container \a c,
which can be any contiguous container of QModelRoleData objects.

View File

@ -2828,7 +2828,7 @@ Qt::PermissionStatus QCoreApplication::checkPermission(const QPermission &permis
}
/*!
\fn template <typename Functor, std::enable_if_t< QtPrivate::AreFunctionsCompatible<RequestPermissionPrototype, Functor>::value, bool> = true> void QCoreApplication::requestPermission(
\fn template <typename Functor> void QCoreApplication::requestPermission(
const QPermission &permission, Functor &&functor)
Requests the given \a permission.

View File

@ -143,11 +143,15 @@ public:
# endif // Q_QDOC
#ifndef QT_NO_CONTEXTLESS_CONNECT
#ifdef Q_QDOC
template <typename Functor>
#else
// requestPermission to a functor or function pointer (without context)
template <typename Functor,
std::enable_if_t<
QtPrivate::AreFunctionsCompatible<RequestPermissionPrototype, Functor>::value,
bool> = true>
#endif
void requestPermission(const QPermission &permission, Functor &&func)
{
requestPermission(permission, nullptr, std::forward<Functor>(func));

View File

@ -226,7 +226,7 @@ Q_LOGGING_CATEGORY(lcPermissions, "qt.permissions", QtWarningMsg);
*/
/*!
\fn template <typename T, if_permission<T>> QPermission::QPermission(const T &type)
\fn template <typename T, QPermission::if_permission<T>> QPermission::QPermission(const T &type)
Constructs a permission from the given \l{typed permission} \a type.
@ -240,7 +240,7 @@ Q_LOGGING_CATEGORY(lcPermissions, "qt.permissions", QtWarningMsg);
*/
/*!
\fn template <typename T, if_permission<T>> std::optional<T> QPermission::value() const
\fn template <typename T, QPermission::if_permission<T>> std::optional<T> QPermission::value() const
Returns the \l{typed permission} of type \c T, or \c{std::nullopt} if this
QPermission object doesn't contain one.

View File

@ -99,8 +99,8 @@
*/
/*!
\fn template <class T> template <typename X, if_convertible<X> = true> QPointer<T>::QPointer(QPointer<X> &&other)
\fn template <class T> template <typename X, if_convertible<X> = true> QPointer<T>::QPointer(const QPointer<X> &other)
\fn template <class T> template <typename X, QPointer<T>::if_convertible<X> = true> QPointer<T>::QPointer(QPointer<X> &&other)
\fn template <class T> template <typename X, QPointer<T>::if_convertible<X> = true> QPointer<T>::QPointer(const QPointer<X> &other)
\since 6.6
Conversion constructor. Constructs a new QPointer by moving or copying from
@ -113,7 +113,7 @@
*/
/*!
\fn template <class T> template <typename X, if_convertible<X> = true> QPointer<T> &QPointer<T>::operator=(const QPointer<X> &other)
\fn template <class T> template <typename X, QPointer<T>::if_convertible<X> = true> QPointer<T> &QPointer<T>::operator=(const QPointer<X> &other)
\since 6.6
Conversion assignment operator. Makes this guarded pointer guard the
@ -124,7 +124,7 @@
*/
/*!
\fn template <class T> template <typename X, if_convertible<X> = true> &QPointer<T>::operator=(QPointer<X> &&other)
\fn template <class T> template <typename X, QPointer<T>::if_convertible<X> = true> &QPointer<T>::operator=(QPointer<X> &&other)
\since 6.6.1
Conversion move-assignment operator. Makes this guarded pointer guard the

View File

@ -544,7 +544,7 @@ QVariant::QVariant(const QVariant &p)
}
/*!
\fn template <typename T, typename... Args, if_constructible<T, Args...> = true> QVariant::QVariant(std::in_place_type_t<T>, Args&&... args) noexcept(is_noexcept_constructible<q20::remove_cvref_t<T>, Args...>::value)
\fn template <typename T, typename... Args, QVariant::if_constructible<T, Args...> = true> QVariant::QVariant(std::in_place_type_t<T>, Args&&... args) noexcept(is_noexcept_constructible<q20::remove_cvref_t<T>, Args...>::value)
\since 6.6
Constructs a new variant containing a value of type \c T. The contained
@ -561,7 +561,7 @@ QVariant::QVariant(const QVariant &p)
/*!
\fn template <typename T, typename U, typename... Args, if_constructible<T, std::initializer_list<U> &, Args...> = true> explicit QVariant::QVariant(std::in_place_type_t<T>, std::initializer_list<U> il, Args&&... args) noexcept(is_noexcept_constructible<q20::remove_cvref_t<T>, std::initializer_list<U> &, Args... >::value)
\fn template <typename T, typename U, typename... Args, QVariant::if_constructible<T, std::initializer_list<U> &, Args...> = true> explicit QVariant::QVariant(std::in_place_type_t<T>, std::initializer_list<U> il, Args&&... args) noexcept(is_noexcept_constructible<q20::remove_cvref_t<T>, std::initializer_list<U> &, Args... >::value)
\since 6.6
\overload
@ -572,7 +572,7 @@ QVariant::QVariant(const QVariant &p)
/*!
\fn template <typename T, typename... Args, if_constructible<T, Args...> = true> QVariant::emplace(Args&&... args)
\fn template <typename T, typename... Args, QVariant::if_constructible<T, Args...> = true> QVariant::emplace(Args&&... args)
\since 6.6
Replaces the object currently held in \c{*this} with an object of
@ -583,7 +583,7 @@ QVariant::QVariant(const QVariant &p)
*/
/*!
\fn template <typename T, typename U, typename... Args, if_constructible<T, std::initializer_list<U> &, Args...> = true> QVariant::emplace(std::initializer_list<U> list, Args&&... args)
\fn template <typename T, typename U, typename... Args, QVariant::if_constructible<T, std::initializer_list<U> &, Args...> = true> QVariant::emplace(std::initializer_list<U> list, Args&&... args)
\since 6.6
\overload
@ -2686,7 +2686,7 @@ QT_WARNING_POP
\sa setValue(), value()
*/
/*! \fn template<typename T, if_rvalue<T> = true> static QVariant QVariant::fromValue(T &&value)
/*! \fn template<typename T, QVariant::if_rvalue<T> = true> static QVariant QVariant::fromValue(T &&value)
\since 6.6
\overload

View File

@ -129,7 +129,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Char, if_compatible_char<Char> = true> QAnyStringView::QAnyStringView(const Char *str, qsizetype len)
\fn template <typename Char, QAnyStringView::if_compatible_char<Char> = true> QAnyStringView::QAnyStringView(const Char *str, qsizetype len)
Constructs a string view on \a str with length \a len.
@ -146,7 +146,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Char, if_compatible_char<Char> = true> QAnyStringView::QAnyStringView(const Char *first, const Char *last)
\fn template <typename Char, QAnyStringView::if_compatible_char<Char> = true> QAnyStringView::QAnyStringView(const Char *first, const Char *last)
Constructs a string view on \a first with length (\a last - \a first).
@ -221,7 +221,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Container, if_compatible_container<Container>> QAnyStringView::QAnyStringView(const Container &str)
\fn template <typename Container, QAnyStringView::if_compatible_container<Container>> QAnyStringView::QAnyStringView(const Container &str)
Constructs a string view on \a str. The length is taken from \c{std::size(str)}.

View File

@ -2134,7 +2134,7 @@ QByteArray& QByteArray::append(char ch)
*/
/*!
\fn template <typename InputIterator, if_input_iterator<InputIterator>> QByteArray &QByteArray::assign(InputIterator first, InputIterator last)
\fn template <typename InputIterator, QByteArray::if_input_iterator<InputIterator>> QByteArray &QByteArray::assign(InputIterator first, InputIterator last)
\since 6.6
Replaces the contents of this byte array with a copy of the elements in the

View File

@ -184,7 +184,7 @@
*/
/*!
\fn template <typename Byte, if_compatible_byte<Byte> = true> QByteArrayView::QByteArrayView(const Byte *data, qsizetype len)
\fn template <typename Byte, QByteArrayView::if_compatible_byte<Byte> = true> QByteArrayView::QByteArrayView(const Byte *data, qsizetype len)
Constructs a byte array view on \a data with length \a len.
@ -202,7 +202,7 @@
*/
/*!
\fn template <typename Byte, if_compatible_byte<Byte> = true> QByteArrayView::QByteArrayView(const Byte *first, const Byte *last)
\fn template <typename Byte, QByteArrayView::if_compatible_byte<Byte> = true> QByteArrayView::QByteArrayView(const Byte *first, const Byte *last)
Constructs a byte array view on \a first with length (\a last - \a first).
@ -270,7 +270,7 @@
*/
/*!
\fn template <typename Container, if_compatible_container<Container> = true> QByteArrayView::QByteArrayView(const Container &c)
\fn template <typename Container, QByteArrayView::if_compatible_container<Container> = true> QByteArrayView::QByteArrayView(const Container &c)
Constructs a byte array view on the array-like container \a c. The length and data
are set via \c{std::size(c)} and \c{std::data(c)} respectively.

View File

@ -3341,7 +3341,7 @@ QString &QString::append(QChar ch)
*/
/*!
\fn template <typename InputIterator, if_compatible_iterator<InputIterator>> QString &QString::assign(InputIterator first, InputIterator last)
\fn template <typename InputIterator, QString::if_compatible_iterator<InputIterator>> QString &QString::assign(InputIterator first, InputIterator last)
\since 6.6
Replaces the contents of this string with a copy of the elements in the

View File

@ -179,7 +179,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Char, if_compatible_char<Char> = true> QStringView::QStringView(const Char *str, qsizetype len)
\fn template <typename Char, QStringView::if_compatible_char<Char> = true> QStringView::QStringView(const Char *str, qsizetype len)
Constructs a string view on \a str with length \a len.
@ -195,7 +195,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Char, if_compatible_char<Char> = true> QStringView::QStringView(const Char *first, const Char *last)
\fn template <typename Char, QStringView::if_compatible_char<Char> = true> QStringView::QStringView(const Char *first, const Char *last)
Constructs a string view on \a first with length (\a last - \a first).
@ -262,7 +262,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Container, if_compatible_container<Container>> QStringView::QStringView(const Container &str)
\fn template <typename Container, QStringView::if_compatible_container<Container>> QStringView::QStringView(const Container &str)
Constructs a string view on \a str. The length is taken from \c{std::size(str)}.
@ -281,7 +281,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename Char, size_t Size, if_compatible_char<Char> = true> static QStringView QStringView::fromArray(const Char (&string)[Size]) noexcept
\fn template <typename Char, size_t Size, QStringView::if_compatible_char<Char> = true> static QStringView QStringView::fromArray(const Char (&string)[Size]) noexcept
Constructs a string view on the full character string literal \a string,
including any trailing \c{Char(0)}. If you don't want the

View File

@ -217,7 +217,7 @@
*/
/*!
\fn template <typename Char, if_compatible_char<Char> = true> QUtf8StringView::QUtf8StringView(const Char *str, qsizetype len)
\fn template <typename Char, QUtf8StringView::if_compatible_char<Char> = true> QUtf8StringView::QUtf8StringView(const Char *str, qsizetype len)
Constructs a string view on \a str with length \a len.
@ -233,7 +233,7 @@
*/
/*!
\fn template <typename Char, if_compatible_char<Char> = true> QUtf8StringView::QUtf8StringView(const Char *first, const Char *last)
\fn template <typename Char, QUtf8StringView::if_compatible_char<Char> = true> QUtf8StringView::QUtf8StringView(const Char *first, const Char *last)
Constructs a string view on \a first with length (\a last - \a first).
@ -287,7 +287,7 @@
*/
/*!
\fn template <typename Container, if_compatible_container<Container>> QUtf8StringView::QUtf8StringView(const Container &str)
\fn template <typename Container, QUtf8StringView::if_compatible_container<Container>> QUtf8StringView::QUtf8StringView(const Container &str)
Constructs a string view on \a str. The length is taken from \c{std::size(str)}.
@ -306,7 +306,7 @@
*/
/*!
\fn template <typename Char, size_t Size, if_compatible_char<Char>> QUtf8StringView::fromArray(const Char (&string)[Size])
\fn template <typename Char, size_t Size, QUtf8StringView::if_compatible_char<Char>> QUtf8StringView::fromArray(const Char (&string)[Size])
Constructs a string view on the full character string literal \a string,
including any trailing \c{Char(0)}. If you don't want the

View File

@ -101,7 +101,7 @@ void QRunnable::QGenericRunnable::run()
*/
/*!
\fn template<typename Callable, if_callable<Callable>> QRunnable *QRunnable::create(Callable &&callableToRun);
\fn template<typename Callable, QRunnable::if_callable<Callable>> QRunnable *QRunnable::create(Callable &&callableToRun);
\since 5.15
Creates a QRunnable that calls \a callableToRun in run().

View File

@ -274,7 +274,7 @@
Constructs a list from the std::initializer_list given by \a args.
*/
/*! \fn template<typename T> template <typename InputIterator, if_input_iterator<InputIterator> = true> QList<T>::QList(InputIterator first, InputIterator last)
/*! \fn template<typename T> template <typename InputIterator, QList<T>::if_input_iterator<InputIterator> = true> QList<T>::QList(InputIterator first, InputIterator last)
\since 5.14
Constructs a list with the contents in the iterator range [\a first, \a last).
@ -1550,7 +1550,7 @@
list or this list is shared.
*/
/*! \fn template <typename T> template <typename InputIterator, if_input_iterator<InputIterator>> QList<T>& QList<T>::assign(InputIterator first, InputIterator last)
/*! \fn template <typename T> template <typename InputIterator, QList<T>::if_input_iterator<InputIterator>> QList<T>& QList<T>::assign(InputIterator first, InputIterator last)
\since 6.6
Replaces the contents of this list with a copy of the elements in the

View File

@ -269,7 +269,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename T, typename Cleanup> template <typename D, if_same_type<D> = true> QScopedArrayPointer<T, Cleanup>::QScopedArrayPointer(D * p)
\fn template <typename T, typename Cleanup> template <typename D, QScopedArrayPointer<T, Cleanup>::if_same_type<D> = true> QScopedArrayPointer<T, Cleanup>::QScopedArrayPointer(D * p)
Constructs a QScopedArrayPointer and stores the array of objects
pointed to by \a p.

View File

@ -103,7 +103,7 @@
lists.
*/
/*! \fn template<class T, qsizetype Prealloc> template<typename InputIterator, if_input_iterator<InputIterator>> QVarLengthArray<T, Prealloc>::QVarLengthArray(InputIterator first, InputIterator last)
/*! \fn template<class T, qsizetype Prealloc> template<typename InputIterator, QVarLengthArray<T, Prealloc>::if_input_iterator<InputIterator>> QVarLengthArray<T, Prealloc>::QVarLengthArray(InputIterator first, InputIterator last)
\since 5.14
Constructs an array with the contents in the iterator range [\a first, \a last).
@ -1006,7 +1006,7 @@
allocate memory if \a n exceeds the capacity of the container.
*/
/*! \fn template <class T, qsizetype Prealloc> template <typename InputIterator, if_input_iterator<InputIterator>> QVarLengthArray<T, Prealloc>& QVarLengthArray<T, Prealloc>::assign(InputIterator first, InputIterator last)
/*! \fn template <class T, qsizetype Prealloc> template <typename InputIterator, QVarLengthArray<T, Prealloc>::if_input_iterator<InputIterator>> QVarLengthArray<T, Prealloc>& QVarLengthArray<T, Prealloc>::assign(InputIterator first, InputIterator last)
\since 6.6
Replaces the contents of this container with a copy of the elements in the

View File

@ -557,7 +557,7 @@ size_t qHash(const QVersionNumber &key, size_t seed)
*/
/*!
\fn template<typename Integer, if_valid_segment_type<Integer> = true> static bool QTypeRevision::isValidSegment(Integer segment)
\fn template<typename Integer, QTypeRevision::if_valid_segment_type<Integer> = true> static bool QTypeRevision::isValidSegment(Integer segment)
Returns true if the given number can be used as either major or minor
version in a QTypeRevision. The valid range for \a segment is \c {>= 0} and \c {< 255}.
@ -572,7 +572,7 @@ size_t qHash(const QVersionNumber &key, size_t seed)
*/
/*!
\fn template<typename Major, typename Minor, if_valid_segment_type<Major> = true, if_valid_segment_type<Minor> = true> static QTypeRevision QTypeRevision::fromVersion(Major majorVersion, Minor minorVersion)
\fn template<typename Major, typename Minor, QTypeRevision::if_valid_segment_type<Major> = true, QTypeRevision::if_valid_segment_type<Minor> = true> static QTypeRevision QTypeRevision::fromVersion(Major majorVersion, Minor minorVersion)
Produces a QTypeRevision from the given \a majorVersion and \a minorVersion,
both of which need to be a valid segments.
@ -581,7 +581,7 @@ size_t qHash(const QVersionNumber &key, size_t seed)
*/
/*!
\fn template<typename Major, if_valid_segment_type<Major> = true> static QTypeRevision QTypeRevision::fromMajorVersion(Major majorVersion)
\fn template<typename Major, QTypeRevision::if_valid_segment_type<Major> = true> static QTypeRevision QTypeRevision::fromMajorVersion(Major majorVersion)
Produces a QTypeRevision from the given \a majorVersion with an invalid minor
version. \a majorVersion needs to be a valid segment.
@ -590,7 +590,7 @@ size_t qHash(const QVersionNumber &key, size_t seed)
*/
/*!
\fn template<typename Minor, if_valid_segment_type<Minor> = true> static QTypeRevision QTypeRevision::fromMinorVersion(Minor minorVersion)
\fn template<typename Minor, QTypeRevision::if_valid_segment_type<Minor> = true> static QTypeRevision QTypeRevision::fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given \a minorVersion with an invalid major
version. \a minorVersion needs to be a valid segment.
@ -599,7 +599,7 @@ size_t qHash(const QVersionNumber &key, size_t seed)
*/
/*!
\fn template<typename Integer, if_valid_value_type<Integer> = true> static QTypeRevision QTypeRevision::fromEncodedVersion(Integer value)
\fn template<typename Integer, QTypeRevision::if_valid_value_type<Integer> = true> static QTypeRevision QTypeRevision::fromEncodedVersion(Integer value)
Produces a QTypeRevision from the given \a value. \a value encodes both the
minor and major versions in the least significant and second least
@ -660,7 +660,7 @@ size_t qHash(const QVersionNumber &key, size_t seed)
*/
/*!
\fn template<typename Integer, if_valid_value_type<Integer> = true> Integer QTypeRevision::toEncodedVersion() const
\fn template<typename Integer, QTypeRevision::if_valid_value_type<Integer> = true> Integer QTypeRevision::toEncodedVersion() const
Transforms the revision into an integer value, encoding the minor
version into the least significant byte, and the major version into