From b6a01d7d22583263a16242af604e74bbe694d766 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 3 Mar 2025 11:54:29 +0000 Subject: [PATCH] Doc: Fix incorrect \fn signatures Several \fn signatures were either incorrect or missing qualifiers required to make QDoc match the documentation with the declarations. These were not caught in the CI when testing documentation builds due to a bug in QDoc. Pick-to: 6.9 Task-number: QTBUG-134250 Change-Id: I7a4af11d9bc3687597b348cc2d4ee15212e0281f Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.cpp | 6 ++++-- src/corelib/kernel/qsocketnotifier.cpp | 2 +- src/corelib/text/qstring.cpp | 6 +++--- src/corelib/tools/qhash.cpp | 16 ++++++++-------- src/gui/math3d/qmatrix4x4.cpp | 3 +-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 54857f9f307..a12efad25ab 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3919,7 +3919,8 @@ void QMetaObject::connectSlotsByName(QObject *o) } /*! - \fn template QMetaObject::Connection QMetaObject::connect(const QObject *sender, const QMetaMethod &signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) + \fn template QMetaObject::Connection QMetaObject::connect( + const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) \threadsafe \overload connect() @@ -3949,7 +3950,8 @@ void QMetaObject::connectSlotsByName(QObject *o) */ /*! - \fn template QMetaObject::Connection QMetaObject::connect(const QObject *sender, const QMetaMethod &signal, const QObject *context, Functor functor, Qt::ConnectionType type) + \fn template QMetaObject::Connection QMetaObject::connect( + const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) \threadsafe \overload connect() diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp index 4e4cf3666bd..22b836c1518 100644 --- a/src/corelib/kernel/qsocketnotifier.cpp +++ b/src/corelib/kernel/qsocketnotifier.cpp @@ -173,7 +173,7 @@ QSocketNotifier::~QSocketNotifier() /*! - \fn void QSocketNotifier::activated(int socket) + \fn void QSocketNotifier::activated(int socket, QPrivateSignal) \deprecated To avoid unintended truncation of the descriptor, use the QSocketDescriptor overload of this function. If you need compatibility with versions older than 5.15 you need to change diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 1b5a7a176e0..c0cc5d16164 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -8761,7 +8761,7 @@ static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, qsizetyp } /*! - \fn template = true> QString QString::arg(const T &a, int fieldWidth, QChar fillChar) const + \fn template = true> QString QString::arg(const T &a, int fieldWidth, QChar fillChar) const Returns a copy of this string with the lowest-numbered place-marker replaced by string \a a, i.e., \c %1, \c %2, ..., \c %99. @@ -8827,7 +8827,7 @@ QString QString::arg_impl(QAnyStringView a, int fieldWidth, QChar fillChar) cons } /*! - \fn template = true> QString QString::arg(T a, int fieldWidth, int base, QChar fillChar) const + \fn template = true> QString QString::arg(T a, int fieldWidth, int base, QChar fillChar) const \overload arg() The \a a argument is expressed in base \a base, which is 10 by @@ -8919,7 +8919,7 @@ QString QString::arg_impl(qulonglong a, int fieldWidth, int base, QChar fillChar } /*! - \fn template = true> QString QString::arg(T a, int fieldWidth, char format, int precision, QChar fillChar) const + \fn template = true> QString QString::arg(T a, int fieldWidth, char format, int precision, QChar fillChar) const \overload arg() Argument \a a is formatted according to the specified \a format and diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 3ab27434e17..3e756bdb478 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1240,7 +1240,7 @@ uint qt_hash(QStringView key, uint chained) noexcept */ /*! - \fn template , bool> = true> size_t qHash(T key, size_t seed) + \fn template , bool> = true> size_t qHash(T key, size_t seed) \since 6.9 \qhashbuiltin @@ -2339,7 +2339,7 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template template QHash::TryEmplaceResult QHash::tryEmplace(const Key &key, Args &&...args) \fn template template QHash::TryEmplaceResult QHash::tryEmplace(Key &&key, Args &&...args) - \fn template template = true, if_key_constructible_from = true> QHash::TryEmplaceResult QHash::tryEmplace(K &&key, Args &&...args) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> QHash::TryEmplaceResult QHash::tryEmplace(K &&key, Args &&...args) \since 6.9 Inserts a new item with the \a key and a value constructed from \a args. @@ -2382,7 +2382,7 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template QHash::TryEmplaceResult QHash::tryInsert(const Key &key, const T &value) - \fn template template = true, if_key_constructible_from = true> QHash::TryEmplaceResult QHash::tryInsert(K &&key, const T &value) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> QHash::TryEmplaceResult QHash::tryInsert(K &&key, const T &value) \since 6.9 Inserts a new item with the \a key and a value of \a value. @@ -2397,7 +2397,7 @@ size_t qHash(long double key, size_t seed) noexcept */ /*! - \fn template template = true, if_key_constructible_from = true> QHash::try_emplace(const_iterator hint, K &&key, Args &&...args) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> iterator QHash::try_emplace(const_iterator hint, K &&key, Args &&...args) \fn template template iterator QHash::try_emplace(const_iterator hint, const Key &key, Args &&...args) \fn template template iterator QHash::try_emplace(const_iterator hint, Key &&key, Args &&...args) \since 6.9 @@ -2418,7 +2418,7 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template template std::pair QHash::try_emplace(const Key &key, Args &&...args) \fn template template std::pair QHash::try_emplace(Key &&key, Args &&...args) - \fn template template = true, if_key_constructible_from = true> QHash::try_emplace(K &&key, Args &&...args) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> std::pair QHash::try_emplace(K &&key, Args &&...args) \since 6.9 Inserts a new item with the \a key and a value constructed from \a args. @@ -2436,7 +2436,7 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template template QHash::TryEmplaceResult QHash::insertOrAssign(const Key &key, Value &&value) \fn template template QHash::TryEmplaceResult QHash::insertOrAssign(Key &&key, Value &&value) - \fn template template = true, if_key_constructible_from = true> QHash::TryEmplaceResult QHash::insertOrAssign(K &&key, Value &&value) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> QHash::TryEmplaceResult QHash::insertOrAssign(K &&key, Value &&value) \since 6.9 Attempts to insert an item with the \a key and \a value. @@ -2453,7 +2453,7 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template template std::pair::key_value_iterator, bool> QHash::insert_or_assign(const Key &key, Value &&value) \fn template template std::pair::key_value_iterator, bool> QHash::insert_or_assign(Key &&key, Value &&value) - \fn template template = true, if_key_constructible_from = true> std::pair::key_value_iterator, bool> QHash::insert_or_assign(K &&key, Value &&value) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> std::pair::key_value_iterator, bool> QHash::insert_or_assign(K &&key, Value &&value) \since 6.9 Attempts to insert an item with the \a key and \a value. @@ -2471,7 +2471,7 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template template std::pair::key_value_iterator, bool> QHash::insert_or_assign(const_iterator hint, const Key &key, Value &&value) \fn template template std::pair::key_value_iterator, bool> QHash::insert_or_assign(const_iterator hint, Key &&key, Value &&value) - \fn template template = true, if_key_constructible_from = true> std::pair::key_value_iterator, bool> QHash::insert_or_assign(const_iterator hint, K &&key, Value &&value) + \fn template template ::if_heterogeneously_searchable = true, QHash::if_key_constructible_from = true> std::pair::key_value_iterator, bool> QHash::insert_or_assign(const_iterator hint, K &&key, Value &&value) \since 6.9 Attempts to insert an item with the \a key and \a value. diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp index 013908a714f..1703fa5b0fe 100644 --- a/src/gui/math3d/qmatrix4x4.cpp +++ b/src/gui/math3d/qmatrix4x4.cpp @@ -729,8 +729,7 @@ QMatrix4x4 operator/(const QMatrix4x4& matrix, float divisor) } /*! - \fn bool qFuzzyCompare(const QMatrix4x4& m1, const QMatrix4x4& m2) - \relates QMatrix4x4 + \fn bool QMatrix4x4::qFuzzyCompare(const QMatrix4x4& m1, const QMatrix4x4& m2) Returns \c true if \a m1 and \a m2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.