From 285bfffc63fe4932f3eb5afc2d96ec54bf3c0055 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 2 Oct 2024 18:46:01 +0200 Subject: [PATCH] Create qdoc macros for C++ class docs 1.1: member-swap(), traditional phrasing We have some patterns for how to document certain functions, but we also vary the sentences a lot, and you have to look up one documentation piece and copy it, essentially. If we ever want to change them, we end up with shotgun surgery. So apply DRY to the documentation and start a collection of macros to help with repetitive C++ class documentation tasks. The first macro is for member-swap(), and the first patch is for documentation that used the traditional phrasing ("Swaps the X \a other with this X."). This doesn't change the documentation, except as follows: * adds the "very fast and never fails" blurb, if it was missing * changes the function's argument name to `other`, as required by the macro. Task-number: QTBUG-129573 Pick-to: 6.7 6.5 6.2 Change-Id: Ib494bd218334724b3b43796ba6f71fb52b83aa94 Reviewed-by: Ivan Solovev (cherry picked from commit 3ccb4ce781463f1b8e0cb4c9283b3067fe92a32e) Reviewed-by: Edward Welbourne --- doc/global/cpp-doc-macros.qdocconf | 15 +++++++++++++++ doc/global/macros.qdocconf | 1 + src/corelib/io/qtemporarydir.cpp | 5 +---- src/corelib/io/qurl.cpp | 4 +--- src/corelib/kernel/qbasictimer.cpp | 4 +--- src/corelib/kernel/qdeadlinetimer.cpp | 3 +-- src/corelib/kernel/qvariant.cpp | 4 +--- src/corelib/text/qbytearray.cpp | 4 +--- src/corelib/text/qlocale.cpp | 4 +--- src/corelib/text/qregularexpression.cpp | 8 ++------ src/corelib/text/qstring.cpp | 4 +--- src/corelib/thread/qpromise.qdoc | 3 +-- src/corelib/tools/qbitarray.cpp | 4 +--- src/corelib/tools/qcommandlineoption.cpp | 4 +--- src/corelib/tools/qcontiguouscache.cpp | 4 +--- src/corelib/tools/qcryptographichash.cpp | 10 ++-------- src/corelib/tools/qeasingcurve.cpp | 4 +--- src/corelib/tools/qhash.cpp | 8 ++------ src/corelib/tools/qlist.qdoc | 4 +--- src/corelib/tools/qmap.qdoc | 4 +--- src/corelib/tools/qmultimap.qdoc | 4 +--- src/corelib/tools/qqueue.cpp | 4 +--- src/corelib/tools/qset.qdoc | 4 +--- src/corelib/tools/qstack.cpp | 4 +--- src/gui/image/qbitmap.cpp | 4 +--- src/gui/image/qicon.cpp | 4 +--- src/gui/image/qimage.cpp | 4 +--- src/gui/image/qpicture.cpp | 4 +--- src/gui/image/qpixmap.cpp | 4 +--- src/gui/kernel/qcursor.cpp | 3 +-- src/gui/kernel/qkeysequence.cpp | 4 +--- src/gui/painting/qbrush.cpp | 4 +--- src/gui/painting/qcolorspace.cpp | 4 +--- src/gui/painting/qpainterpath.cpp | 4 +--- src/gui/painting/qpdfoutputintent.cpp | 4 +--- src/gui/painting/qpen.cpp | 4 +--- src/gui/painting/qpolygon.cpp | 8 ++------ src/gui/painting/qregion.cpp | 4 +--- src/gui/rhi/qshader.cpp | 4 +--- src/network/access/qhstspolicy.cpp | 3 +-- src/network/access/qhttp2configuration.cpp | 2 +- src/network/kernel/qhostinfo.cpp | 5 +---- src/opengl/qopenglbuffer.cpp | 4 +--- src/opengl/qopengldebug.cpp | 6 ++---- src/sql/kernel/qsqlerror.cpp | 4 +--- src/sql/kernel/qsqlrecord.cpp | 4 +--- 46 files changed, 65 insertions(+), 143 deletions(-) create mode 100644 doc/global/cpp-doc-macros.qdocconf diff --git a/doc/global/cpp-doc-macros.qdocconf b/doc/global/cpp-doc-macros.qdocconf new file mode 100644 index 00000000000..ce98d5cae4f --- /dev/null +++ b/doc/global/cpp-doc-macros.qdocconf @@ -0,0 +1,15 @@ +# Macros for documenting repetitive aspects of C++ classes + +# Sort groups alphabetically + +# +# Macros for swap() +# + +# \memberswap{what} +# what - a prose version of the type of object (e.g. "string", "collator", "pen") +# The function's argument name must be \a other. +macro.memberswap = \ + "\n\n" \ + "Swaps \1 \\a{other} with this \1. This operation is very fast and never fails." \ + "\n\n" diff --git a/doc/global/macros.qdocconf b/doc/global/macros.qdocconf index 2bc381cab65..24a0d8c0fd5 100644 --- a/doc/global/macros.qdocconf +++ b/doc/global/macros.qdocconf @@ -173,3 +173,4 @@ macro.qtpolicydeprecatedbehavior = "\\note The \\c{OLD} behavior of a policy is macro.techpreview = "(Technical preview)\n\n\\meta status {Technical preview}\n\\ingroup tech_preview\n" include(grid.qdocconf) +include(cpp-doc-macros.qdocconf) diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 490ad595d43..61512419936 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -192,10 +192,7 @@ QTemporaryDir::QTemporaryDir(const QString &templatePath) /*! \fn void QTemporaryDir::swap(QTemporaryDir &other) - - Swaps temporary-dir \a other with this temporary-dir. This operation is - very fast and never fails. - + \memberswap{temporary-dir} \since 6.4 */ diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 2b34c6b8bcb..5706327a5c5 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3229,9 +3229,7 @@ QUrl &QUrl::operator =(const QString &url) /*! \fn void QUrl::swap(QUrl &other) \since 4.8 - - Swaps URL \a other with this URL. This operation is very - fast and never fails. + \memberswap{URL} */ /*! diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp index 613c0e696d6..9874c34e442 100644 --- a/src/corelib/kernel/qbasictimer.cpp +++ b/src/corelib/kernel/qbasictimer.cpp @@ -85,9 +85,7 @@ QT_BEGIN_NAMESPACE /*! \fn QBasicTimer::swap(QBasicTimer &other) \since 5.14 - - Swaps the timer \a other with this timer. - This operation is very fast and never fails. + \memberswap{timer} */ /*! diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp index f99e68f990b..518fc3f60d5 100644 --- a/src/corelib/kernel/qdeadlinetimer.cpp +++ b/src/corelib/kernel/qdeadlinetimer.cpp @@ -729,8 +729,7 @@ QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs) /*! \fn void QDeadlineTimer::swap(QDeadlineTimer &other) - - Swaps this deadline timer with the \a other deadline timer. + \memberswap{deadline timer} */ /*! diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 92a44c462b0..b84cd7e2749 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1074,9 +1074,7 @@ QVariant &QVariant::operator=(const QVariant &variant) /*! \fn void QVariant::swap(QVariant &other) \since 4.8 - - Swaps variant \a other with this variant. This operation is very - fast and never fails. + \memberswap{variant} */ /*! diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index ee0426d8e8b..bb175aeabe0 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -1397,9 +1397,7 @@ QByteArray &QByteArray::operator=(const char *str) /*! \fn void QByteArray::swap(QByteArray &other) \since 4.8 - - Swaps byte array \a other with this byte array. This operation is very - fast and never fails. + \memberswap{byte array} */ /*! \fn qsizetype QByteArray::size() const diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 067b7ae3ab2..bfca8a83485 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -1191,9 +1191,7 @@ bool QLocale::equals(const QLocale &other) const noexcept /*! \fn void QLocale::swap(QLocale &other) \since 5.6 - - Swaps locale \a other with this locale. This operation is very fast and - never fails. + \memberswap{locale} */ /*! diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp index 6073a965de1..da928c0571b 100644 --- a/src/corelib/text/qregularexpression.cpp +++ b/src/corelib/text/qregularexpression.cpp @@ -1389,9 +1389,7 @@ QRegularExpression &QRegularExpression::operator=(const QRegularExpression &re) /*! \fn void QRegularExpression::swap(QRegularExpression &other) - - Swaps the regular expression \a other with this regular expression. This - operation is very fast and never fails. + \memberswap{reglar expression} */ /*! @@ -2155,9 +2153,7 @@ QRegularExpressionMatch &QRegularExpressionMatch::operator=(const QRegularExpres /*! \fn void QRegularExpressionMatch::swap(QRegularExpressionMatch &other) - - Swaps the match result \a other with this match result. This - operation is very fast and never fails. + \memberswap{match result} */ /*! diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 90cff2370ee..6d66b578695 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -2604,9 +2604,7 @@ QString::QString(QChar ch) /*! \fn void QString::swap(QString &other) \since 4.8 - - Swaps string \a other with this string. This operation is very fast and - never fails. + \memberswap{string} */ /*! \fn void QString::detach() diff --git a/src/corelib/thread/qpromise.qdoc b/src/corelib/thread/qpromise.qdoc index ef6913fd3d3..c5397997faa 100644 --- a/src/corelib/thread/qpromise.qdoc +++ b/src/corelib/thread/qpromise.qdoc @@ -289,6 +289,5 @@ */ /*! \fn template void QPromise::swap(QPromise &other) noexcept - - Swaps promise \a other with this promise. This operation is very fast and never fails. + \memberswap{promise} */ diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index d5643df0250..46e4af37b0f 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -496,9 +496,7 @@ quint32 QBitArray::toUInt32(QSysInfo::Endian endianness, bool *ok) const noexcep /*! \fn void QBitArray::swap(QBitArray &other) \since 4.8 - - Swaps bit array \a other with this bit array. This operation is very - fast and never fails. + \memberswap{bit array} */ /*! \fn bool QBitArray::operator==(const QBitArray &lhs, const QBitArray &rhs) diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp index 6b990cecf17..3d8d2536ee6 100644 --- a/src/corelib/tools/qcommandlineoption.cpp +++ b/src/corelib/tools/qcommandlineoption.cpp @@ -197,9 +197,7 @@ QCommandLineOption &QCommandLineOption::operator=(const QCommandLineOption &othe /*! \fn void QCommandLineOption::swap(QCommandLineOption &other) - - Swaps option \a other with this option. This operation is very - fast and never fails. + \memberswap{option} */ /*! diff --git a/src/corelib/tools/qcontiguouscache.cpp b/src/corelib/tools/qcontiguouscache.cpp index d28d1e71530..4a3fd73dc1f 100644 --- a/src/corelib/tools/qcontiguouscache.cpp +++ b/src/corelib/tools/qcontiguouscache.cpp @@ -164,9 +164,7 @@ void QContiguousCacheData::freeData(QContiguousCacheData *data) /*! \fn template void QContiguousCache::swap(QContiguousCache &other) \since 4.8 - - Swaps cache \a other with this cache. This operation is very - fast and never fails. + \memberswap{cache} */ /*! \fn template bool QContiguousCache::operator==(const QContiguousCache &other) const diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 2899f7741b2..aefb91abecb 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -467,10 +467,7 @@ QCryptographicHash::~QCryptographicHash() /*! \fn void QCryptographicHash::swap(QCryptographicHash &other) - - Swaps cryptographic hash \a other with this cryptographic hash. This - operation is very fast and never fails. - + \memberswap{cryptographic hash} \since 6.5 */ @@ -1479,10 +1476,7 @@ QMessageAuthenticationCode::~QMessageAuthenticationCode() /*! \fn void QMessageAuthenticationCode::swap(QMessageAuthenticationCode &other) - - Swaps message authentication code \a other with this message authentication - code. This operation is very fast and never fails. - + \memberswap{message authentication code} \since 6.6 */ diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 06369528e88..3d01855f811 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1147,9 +1147,7 @@ QEasingCurve::~QEasingCurve() /*! \fn void QEasingCurve::swap(QEasingCurve &other) \since 5.0 - - Swaps curve \a other with this curve. This operation is very - fast and never fails. + \memberswap{curve} */ /*! diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 470682fc758..c293cf11feb 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1780,16 +1780,12 @@ size_t qHash(long double key, size_t seed) noexcept /*! \fn template void QHash::swap(QHash &other) \since 4.8 - - Swaps hash \a other with this hash. This operation is very - fast and never fails. + \memberswap{hash} */ /*! \fn template void QMultiHash::swap(QMultiHash &other) \since 4.8 - - Swaps hash \a other with this hash. This operation is very - fast and never fails. + \memberswap{multi-hash} */ /*! \fn template bool QHash::operator==(const QHash &other) const diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc index 19b10fde4d1..bc5feac7a0f 100644 --- a/src/corelib/tools/qlist.qdoc +++ b/src/corelib/tools/qlist.qdoc @@ -342,9 +342,7 @@ /*! \fn template void QList::swap(QList &other) \since 4.8 - - Swaps list \a other with this list. This operation is very fast and - never fails. + \memberswap{list} */ /*! \fn template void QList::swapItemsAt(qsizetype i, qsizetype j) diff --git a/src/corelib/tools/qmap.qdoc b/src/corelib/tools/qmap.qdoc index 0cabf3df38c..f3af9122327 100644 --- a/src/corelib/tools/qmap.qdoc +++ b/src/corelib/tools/qmap.qdoc @@ -171,9 +171,7 @@ /*! \fn template void QMap::swap(QMap &other) noexcept \since 4.8 - - Swaps map \a other with this map. This operation is very - fast and never fails. + \memberswap{map} */ /*! \fn template QMap::QMap(std::initializer_list > list) diff --git a/src/corelib/tools/qmultimap.qdoc b/src/corelib/tools/qmultimap.qdoc index 0b05192817d..96628874e9c 100644 --- a/src/corelib/tools/qmultimap.qdoc +++ b/src/corelib/tools/qmultimap.qdoc @@ -217,9 +217,7 @@ /*! \fn template void QMultiMap::swap(QMultiMap &other) \since 4.8 - - Swaps multi map \a other with this multi map. This operation is very - fast and never fails. + \memberswap{multi map} */ /*! \fn template bool QMultiMap::operator==(const QMultiMap &lhs, const QMultiMap &rhs) diff --git a/src/corelib/tools/qqueue.cpp b/src/corelib/tools/qqueue.cpp index 82095faa3d6..74ab49b3bf9 100644 --- a/src/corelib/tools/qqueue.cpp +++ b/src/corelib/tools/qqueue.cpp @@ -43,9 +43,7 @@ /*! \fn template void QQueue::swap(QQueue &other) \since 4.8 - - Swaps queue \a other with this queue. This operation is very - fast and never fails. + \memberswap{queue} */ /*! diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index 4ef7a80a52d..817d675591b 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -99,9 +99,7 @@ /*! \fn template void QSet::swap(QSet &other) - - Swaps set \a other with this set. This operation is very fast and - never fails. + \memberswap{set} */ /*! diff --git a/src/corelib/tools/qstack.cpp b/src/corelib/tools/qstack.cpp index 5255e0e100d..da8123b0584 100644 --- a/src/corelib/tools/qstack.cpp +++ b/src/corelib/tools/qstack.cpp @@ -43,9 +43,7 @@ /*! \fn template void QStack::swap(QStack &other) \since 4.8 - - Swaps stack \a other with this stack. This operation is very fast and - never fails. + \memberswap{stack} */ /*! diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp index 315c847c919..c9310bef666 100644 --- a/src/gui/image/qbitmap.cpp +++ b/src/gui/image/qbitmap.cpp @@ -129,9 +129,7 @@ QBitmap::QBitmap(const QString& fileName, const char *format) /*! \fn void QBitmap::swap(QBitmap &other) - - Swaps bitmap \a other with this bitmap. This operation is very - fast and never fails. + \memberswap{bitmap} */ /*! diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 0220b05d959..a3cb5d32f14 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -827,9 +827,7 @@ QIcon &QIcon::operator=(const QIcon &other) /*! \fn void QIcon::swap(QIcon &other) - - Swaps icon \a other with this icon. This operation is very - fast and never fails. + \memberswap{icon} */ /*! diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 0e95978fe0b..ebec640b47d 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1091,9 +1091,7 @@ QImage &QImage::operator=(const QImage &image) /*! \fn void QImage::swap(QImage &other) - - Swaps image \a other with this image. This operation is very - fast and never fails. + \memberswap{image} */ /*! diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 0bc21a3e9f7..9e902d69b82 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -925,9 +925,7 @@ QPicture& QPicture::operator=(const QPicture &p) /*! \fn void QPicture::swap(QPicture &other) - - Swaps picture \a other with this picture. This operation is very - fast and never fails. + \memberswap{picture} */ /*! diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index a6625fc4716..cbfb5e2d8d4 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -368,9 +368,7 @@ QPixmap &QPixmap::operator=(const QPixmap &pixmap) /*! \fn void QPixmap::swap(QPixmap &other) - - Swaps pixmap \a other with this pixmap. This operation is very - fast and never fails. + \memberswap{pixmap} */ /*! diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 8e7747559ad..268d0b2f144 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -137,8 +137,7 @@ QT_BEGIN_NAMESPACE /*! \fn void QCursor::swap(QCursor &other) - - Swaps this cursor with the \a other cursor. + \memberswap{cursor} \since 5.7 */ diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 0529d940d2a..cf8cd774b74 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1385,9 +1385,7 @@ QKeySequence &QKeySequence::operator=(const QKeySequence &other) /*! \fn void QKeySequence::swap(QKeySequence &other) \since 4.8 - - Swaps key sequence \a other with this key sequence. This operation is very - fast and never fails. + \memberswap{key sequence} */ /*! diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index b0538962332..5a6fbd8232a 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -625,9 +625,7 @@ QBrush &QBrush::operator=(const QBrush &b) /*! \fn void QBrush::swap(QBrush &other) \since 4.8 - - Swaps brush \a other with this brush. This operation is very - fast and never fails. + \memberswap{brush} */ /*! diff --git a/src/gui/painting/qcolorspace.cpp b/src/gui/painting/qcolorspace.cpp index 0a38b2ec140..e93cf0caebf 100644 --- a/src/gui/painting/qcolorspace.cpp +++ b/src/gui/painting/qcolorspace.cpp @@ -783,9 +783,7 @@ QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QColorSpacePrivate) QColorSpace::QColorSpace(const QColorSpace &colorSpace) noexcept = default; /*! \fn void QColorSpace::swap(QColorSpace &other) - - Swaps color space \a other with this color space. This operation is very fast and - never fails. + \memberswap{color space} */ /*! diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e55422a672c..d79c85c8f5d 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -563,9 +563,7 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other) /*! \fn void QPainterPath::swap(QPainterPath &other) \since 4.8 - - Swaps painter path \a other with this painter path. This operation is very - fast and never fails. + \memberswap{painer path} */ /*! diff --git a/src/gui/painting/qpdfoutputintent.cpp b/src/gui/painting/qpdfoutputintent.cpp index b960986c8d3..519dab6db28 100644 --- a/src/gui/painting/qpdfoutputintent.cpp +++ b/src/gui/painting/qpdfoutputintent.cpp @@ -80,9 +80,7 @@ QPdfOutputIntent::~QPdfOutputIntent() = default; /*! \fn void QPdfOutputIntent::swap(QPdfOutputIntent &other) noexcept - - Swaps the output intent \a other with this output intent. This - operation is very fast and never fails. + \memberswap{output intent} */ /*! diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index ce1ad6e129e..fc151763aac 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -341,9 +341,7 @@ QPen &QPen::operator=(const QPen &p) noexcept /*! \fn void QPen::swap(QPen &other) \since 4.8 - - Swaps pen \a other with this pen. This operation is very - fast and never fails. + \memberswap{pen} */ /*! diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index d615245eb48..c9153602074 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -623,17 +623,13 @@ QPolygon QPolygonF::toPolygon() const /*! \fn void QPolygon::swap(QPolygon &other) \since 4.8 - - Swaps polygon \a other with this polygon. This operation is very - fast and never fails. + \memberswap{polygon} */ /*! \fn void QPolygonF::swap(QPolygonF &other) \since 4.8 - - Swaps polygon \a other with this polygon. This operation is very - fast and never fails. + \memberswap{polygon} */ /*! diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index f9089d7bba2..493d7898d06 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -296,9 +296,7 @@ void QRegion::exec(const QByteArray &buffer, int ver, QDataStream::ByteOrder byt /*! \fn void QRegion::swap(QRegion &other) \since 4.8 - - Swaps region \a other with this region. This operation is very - fast and never fails. + \memberswap{region} */ /*! diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp index d5fb53e7e6a..3a5fa3da0fb 100644 --- a/src/gui/rhi/qshader.cpp +++ b/src/gui/rhi/qshader.cpp @@ -332,9 +332,7 @@ QShader::~QShader() /*! \fn void QShader::swap(QShader &other) \since 6.7 - - Swaps shader \a other with this shader. This operation is very fast and - never fails. + \memberswap{shader} */ /*! diff --git a/src/network/access/qhstspolicy.cpp b/src/network/access/qhstspolicy.cpp index 323e562c3c5..e1afbc02bf5 100644 --- a/src/network/access/qhstspolicy.cpp +++ b/src/network/access/qhstspolicy.cpp @@ -198,8 +198,7 @@ bool QHstsPolicy::isExpired() const /*! \fn void QHstsPolicy::swap(QHstsPolicy &other) - - Swaps this policy with the \a other policy. + \memberswap{policy} */ QT_END_NAMESPACE diff --git a/src/network/access/qhttp2configuration.cpp b/src/network/access/qhttp2configuration.cpp index b718ddc7559..cfaa2f6c3c4 100644 --- a/src/network/access/qhttp2configuration.cpp +++ b/src/network/access/qhttp2configuration.cpp @@ -254,7 +254,7 @@ unsigned QHttp2Configuration::maxFrameSize() const } /*! - Swaps this configuration with the \a other configuration. + \memberswap{configuration} */ void QHttp2Configuration::swap(QHttp2Configuration &other) noexcept { diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 16037092733..82c9e08c889 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -249,10 +249,7 @@ int QHostInfo::lookupHost(const QString &name, const QObject *receiver, const ch /*! \fn void QHostInfo::swap(QHostInfo &other) - - Swaps host-info \a other with this host-info. This operation is - very fast and never fails. - + \memberswap{host-info} \since 5.10 */ diff --git a/src/opengl/qopenglbuffer.cpp b/src/opengl/qopenglbuffer.cpp index 64e79750430..34ad5aa82d9 100644 --- a/src/opengl/qopenglbuffer.cpp +++ b/src/opengl/qopenglbuffer.cpp @@ -216,9 +216,7 @@ QOpenGLBuffer &QOpenGLBuffer::operator=(const QOpenGLBuffer &other) /*! \fn QOpenGLBuffer::swap(QOpenGLBuffer &other) \since 6.5 - - Swaps buffer \a other with this buffer. This operation is very fast and - never fails. + \memberswap{buffer} */ /*! diff --git a/src/opengl/qopengldebug.cpp b/src/opengl/qopengldebug.cpp index aa2738bb506..dfc82dcdd66 100644 --- a/src/opengl/qopengldebug.cpp +++ b/src/opengl/qopengldebug.cpp @@ -846,10 +846,8 @@ QOpenGLDebugMessage &QOpenGLDebugMessage::operator=(const QOpenGLDebugMessage &d */ /*! - \fn void QOpenGLDebugMessage::swap(QOpenGLDebugMessage &debugMessage) - - Swaps the message \a debugMessage with this message. This operation is very - fast and never fails. + \fn void QOpenGLDebugMessage::swap(QOpenGLDebugMessage &other) + \memberswap{message] */ /*! diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp index a52f209d531..595cc89427e 100644 --- a/src/sql/kernel/qsqlerror.cpp +++ b/src/sql/kernel/qsqlerror.cpp @@ -78,9 +78,7 @@ QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QSqlErrorPrivate) */ /*! \fn QSqlError::swap(QSqlError &other) - Swaps error \a other with this error. This operation is very fast - and never fails. - + \memberswap{error} \since 5.10 */ diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp index 3c3b2b33909..6cbf9005ad4 100644 --- a/src/sql/kernel/qsqlrecord.cpp +++ b/src/sql/kernel/qsqlrecord.cpp @@ -130,9 +130,7 @@ QSqlRecord::QSqlRecord(const QSqlRecord &other) /*! \fn void QSqlRecord::swap(QSqlRecord &other) \since 6.6 - - Swaps SQL record \a other with this SQL record. This operation is very fast - and never fails. + \memberswap{SQL record} */