From c46551e2033061596bf3cc28a96aaf71574e1e59 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 6 Sep 2023 12:44:31 +0000 Subject: [PATCH] Doc: Fix documentation issues Fix the following QDoc warnings: * warning: Can't link to 'QRhiWidget::sampleConut' * warning: Can't link to '`Q_NODISCARD_CTOR' * warning: Invalid '\relates' (already a member of 'QEventLoopLocker') * warning: Unknown command '\relatesalso' * warning: Undocumented parameter 'separator' in QLocale::name() * warning: clang couldn't find function when parsing \fn void QRhiWidget::framePresented() In QAtomicPointer, work around the issue of QDoc not supporting multiple \relates command for a single topic by adding a see-also link to the global qYieldCpu() function. Document the qvariant_cast() overload taking an rvalue reference. Change-Id: I2528eee666149a97a14be059bbed537636d7aa0d Reviewed-by: Thiago Macieira --- examples/widgets/doc/src/cuberhiwidget.qdoc | 2 +- src/corelib/global/qcompilerdetection.qdoc | 4 ++-- src/corelib/kernel/qeventloop.cpp | 1 - src/corelib/kernel/qvariant.cpp | 8 ++++++++ src/corelib/text/qanystringview.cpp | 3 +-- src/corelib/text/qlocale.cpp | 3 ++- src/corelib/thread/qatomic.cpp | 2 +- src/corelib/thread/qyieldcpu.qdoc | 2 +- src/widgets/kernel/qrhiwidget.cpp | 2 +- 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/examples/widgets/doc/src/cuberhiwidget.qdoc b/examples/widgets/doc/src/cuberhiwidget.qdoc index 98aad324381..6356ead9590 100644 --- a/examples/widgets/doc/src/cuberhiwidget.qdoc +++ b/examples/widgets/doc/src/cuberhiwidget.qdoc @@ -31,7 +31,7 @@ \li The contents of the QRhiWidget \l{QRhiWidget::grab()}{can be read back} and saved to an image file (e.g. a PNG file). - \li 4x multisample antialiasing \l{QRhiWidget::sampleConut}{can be toggled} + \li 4x multisample antialiasing \l{QRhiWidget::sampleCount()}{can be toggled} at run time. The QRhiWidget subclass is prepared to handle the changing sample count correctly. diff --git a/src/corelib/global/qcompilerdetection.qdoc b/src/corelib/global/qcompilerdetection.qdoc index 1f521e31f61..191f26cc1fa 100644 --- a/src/corelib/global/qcompilerdetection.qdoc +++ b/src/corelib/global/qcompilerdetection.qdoc @@ -421,7 +421,7 @@ \brief Expand to \c{[[nodiscard(message)]]} on compilers that support the feature. - Otherwise they expand to [[nodiscard]] and Q_NODISCARD_CTOR, respectively. + Otherwise they expand to \c {[[nodiscard]]} and Q_NODISCARD_CTOR, respectively. - \sa`Q_NODISCARD_CTOR + \sa Q_NODISCARD_CTOR */ diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp index f754a975b96..dcd5f6d5c07 100644 --- a/src/corelib/kernel/qeventloop.cpp +++ b/src/corelib/kernel/qeventloop.cpp @@ -403,7 +403,6 @@ QEventLoopLocker::QEventLoopLocker(QThread *thread) noexcept /*! \fn QEventLoopLocker::swap(QEventLoopLocker &lhs, QEventLoopLocker &rhs) - \relates QEventLoopLocker \since 6.7 Swaps the object and the state of \a lhs with \a rhs. diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 9f948d5b1fb..2c8e61fa349 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2722,6 +2722,14 @@ QT_WARNING_POP \sa QVariant::value() */ +/*! + \fn template T QVariant::qvariant_cast(QVariant &&value) + \overload + \since 6.7 + + Returns the given \a value converted to the template type \c{T}. +*/ + /*! \fn template T qVariantValue(const QVariant &value) \relates QVariant \deprecated diff --git a/src/corelib/text/qanystringview.cpp b/src/corelib/text/qanystringview.cpp index 73c01d9718d..65655a5e97b 100644 --- a/src/corelib/text/qanystringview.cpp +++ b/src/corelib/text/qanystringview.cpp @@ -606,8 +606,7 @@ QT_BEGIN_NAMESPACE /*! \fn QAnyStringView::operator<<(QDebug d, QAnyStringView s) \since 6.7 - \relates QAnyStringView - \relatesalso QDebug + \relates QDebug Outputs \a s to debug stream \a d. diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index e3d0842561d..ff604d773c3 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -1380,7 +1380,8 @@ Q_DECL_COLD_FUNCTION static void badSeparatorWarning(const char *method, char se "language_territory", where language is a lowercase, two-letter ISO 639 language code, and territory is an uppercase, two- or three-letter ISO 3166 territory code. If the locale has no specified territory, only the language - name is returned. + name is returned. An optional \a separator parameter overrides the default + underscore character separating the two tags. Even if the QLocale object was constructed with an explicit script, name() will not contain it for compatibility reasons. Use \l bcp47Name() instead if diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp index 210218d72d4..4843556eb50 100644 --- a/src/corelib/thread/qatomic.cpp +++ b/src/corelib/thread/qatomic.cpp @@ -1359,7 +1359,7 @@ \endlist - \sa QAtomicInteger + \sa QAtomicInteger, qYieldCpu() */ /*! diff --git a/src/corelib/thread/qyieldcpu.qdoc b/src/corelib/thread/qyieldcpu.qdoc index 9a5f693cb4f..2488ca8cc81 100644 --- a/src/corelib/thread/qyieldcpu.qdoc +++ b/src/corelib/thread/qyieldcpu.qdoc @@ -7,7 +7,7 @@ \inmodule QtCore \ingroup thread \relates QAtomicInteger - \relatesalso QAtomicPointer + //! \relatesalso QAtomicPointer \since 6.7 Pauses the execution of the current thread for an unspecified time, using diff --git a/src/widgets/kernel/qrhiwidget.cpp b/src/widgets/kernel/qrhiwidget.cpp index 8f6e79d81df..08d4af63e99 100644 --- a/src/widgets/kernel/qrhiwidget.cpp +++ b/src/widgets/kernel/qrhiwidget.cpp @@ -1284,7 +1284,7 @@ QRhiRenderTarget *QRhiWidget::renderTarget() const } /*! - \fn void QRhiWidget::framePresented() + \fn void QRhiWidget::frameSubmitted() This signal is emitted after the widget's top-level window has finished composition and has \l{QRhi::endFrame()}{submitted a frame}.