From ec1548ae122af2febfc61c0242025ee52c8cbc30 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 31 Oct 2018 13:49:14 +0100 Subject: Doc: Fix various documentation warnings These include typos, marking functions as \internal, documenting trivial things, and fixing the function signatures passed to the \fn command. Task-number: QTBUG-71502 Change-Id: I24a9e1f7e1cdb39e5c31b99202bdd593c6b789ff Reviewed-by: Martin Smith Reviewed-by: Paul Wicking Reviewed-by: Edward Welbourne --- src/corelib/tools/qbytearray.cpp | 4 ++-- src/corelib/tools/qmap.cpp | 2 +- src/corelib/tools/qregularexpression.cpp | 4 ++-- src/corelib/tools/qshareddata.cpp | 7 +++++++ src/corelib/tools/qstring.cpp | 2 +- src/corelib/tools/qtimezone.cpp | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 8f2ad8c012..53ae7b9452 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -3076,7 +3076,7 @@ bool QByteArray::endsWith(const char *str) const return qstrncmp(d->data() + d->size - len, str, len) == 0; } -/*! +/* Returns true if \a c is an uppercase Latin1 letter. \note The multiplication sign 0xD7 and the sz ligature 0xDF are not treated as uppercase Latin1. @@ -3112,7 +3112,7 @@ bool QByteArray::isUpper() const return true; } -/*! +/* Returns true if \a c is an lowercase Latin1 letter. \note The division sign 0xF7 is not treated as lowercase Latin1, but the small y dieresis 0xFF is. diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index d7844f3128..5f7275c5f8 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -537,7 +537,7 @@ void QMapDataBase::freeData(QMapDataBase *d) \sa operator=() */ -/*! \fn template QMap::QMap(const std::map & other) +/*! \fn template QMap::QMap(const typename std::map & other) Constructs a copy of \a other. diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index fec5f620fc..908e7ff0d6 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -2000,8 +2000,8 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern) \since 5.12 - Returns the expression wrapped between the \c{\A} and \c{\z} anchors to be - used for exact matching. + Returns the \a expression wrapped between the \c{\A} and \c{\z} anchors to + be used for exact matching. \sa {Porting from QRegExp's Exact Matching} */ diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp index bc4291e20f..c334f71fa0 100644 --- a/src/corelib/tools/qshareddata.cpp +++ b/src/corelib/tools/qshareddata.cpp @@ -579,6 +579,13 @@ QT_BEGIN_NAMESPACE the shared data object if the reference count became 0. */ +/*! \fn template T *QExplicitlySharedDataPointer::take() + \since 5.12 + + Returns a pointer to the shared object, and resets \e this to be null. + That is, this function sets the \e{d pointer} of \e this to \c nullptr. + */ + /*! \fn template QExplicitlySharedDataPointer::operator bool () const Returns \c true if the \e{d pointer} of \e this is \e not null. */ diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index c89635cfdb..fb7fb64223 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -254,7 +254,7 @@ inline RetType UnrollTailLoop<0>::exec(Number, RetType returnIfExited, Functor1, /*! * \internal * - * Searches for character \a \c in the string \a str and returns a pointer to + * Searches for character \a c in the string \a str and returns a pointer to * it. Unlike strchr() and wcschr() (but like glibc's strchrnul()), if the * character is not found, this function returns a pointer to the end of the * string -- that is, \c{str.end()}. diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index db6be581ec..cbc6b50c98 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -217,7 +217,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz); This class includes data obtained from the CLDR data files under the terms of the Unicode Data Files and Software License. See - \l{Unicode CLDR (Unicode Common Locale Data Repository)} for the details. + \l{Unicode Common Locale Data Repository (CLDR)} for details. \sa QDateTime */ -- cgit v1.2.3 From 4615415500bfa816b6010cfd47162899dd72c682 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 30 Oct 2018 14:01:00 +0100 Subject: Doc: Tie the QScopeGuard documentation to a class Previously no documentation was generated for the global qScopeGuard() function. Create a class documentation page and add the the function as a related non-member using \relates. Task-number: QTBUG-71502 Change-Id: Ida5d7044f4de962360dfee9321feb49005d4b299 Reviewed-by: Martin Smith --- src/corelib/tools/qscopeguard.qdoc | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qscopeguard.qdoc b/src/corelib/tools/qscopeguard.qdoc index 7cbc3e9c7b..70e13ab2fd 100644 --- a/src/corelib/tools/qscopeguard.qdoc +++ b/src/corelib/tools/qscopeguard.qdoc @@ -30,24 +30,36 @@ QT_BEGIN_NAMESPACE /*! - \fn const QScopeGuard qScopeGuard(F f) - \inmodule QtCore - \brief The qScopeGuard function can be used to call a function at the end of the scope. + \class QScopeGuard \since 5.12 + \inmodule QtCore + \brief Provides a scope guard for calling a function at the of + a scope. +*/ + +/*! + \fn template const QScopeGuard qScopeGuard(F f) + \inmodule QtCore + \relates QScopeGuard + \brief The qScopeGuard function can be used to call a function at the end + of the scope. \ingroup misc - QScopeGuard is a class which sole purpose is to run a function F in its destructor. - This is useful for guaranteeing your cleanup code is executed whether the function is exited normally, - exited early by a return statement, or exited by an exception. + QScopeGuard is a class which sole purpose is to run a function \e F in + its destructor. This is useful for guaranteeing your cleanup code is + executed, whether the function is exited normally, exited early by a return + statement, or exited by an exception. - If F is a lambda then you cannot instantiate the template directly, therefore the qScopeGuard() helper - is provided and QScopeGuard is made a private implementation detail. + If \e F is a lambda then you cannot instantiate the template directly, + therefore the qScopeGuard() helper is provided and QScopeGuard is made a + private implementation detail. Example usage is as follows: \snippet code/src_corelib_tools_qscopeguard.cpp 0 - \note Exceptions are not supported. The callable shouldn't throw when executed, copied or moved. + \note Exceptions are not supported. The callable shouldn't throw when + executed, copied or moved. \sa QScopedValueRollback */ -- cgit v1.2.3