summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2020-11-09 14:04:57 +0100
committerKarsten Heimrich <karsten.heimrich@qt.io>2020-11-11 12:48:21 +0100
commitbd3a1dd9c287e0a1c35d013c57d83a55de52a470 (patch)
tree0bc28643dc53248ab007edf5b8debaf67e43f03c /src/corelib/text/qstring.cpp
parent15f55e9be57822b2c9ceb602cabd5075c1921ed2 (diff)
Doc: Update/scrub QString documentation
Fixes: QTBUG-86554 Change-Id: I3d40295115207c430ec30bbac6fb241bf897e5fa Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 32e5bb7b20..76b25427bd 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -1618,7 +1618,7 @@ inline char qToLower(char ch)
The at() function can be faster than \l operator[](), because it
never causes a \l{deep copy} to occur. Alternatively, use the
- left(), right(), or mid() functions to extract several characters
+ first(), last(), or sliced() functions to extract several characters
at a time.
A QString can embed '\\0' characters (QChar::Null). The size()
@@ -1917,7 +1917,7 @@ inline char qToLower(char ch)
Such considerations, the configuration of such behavior or any mitigation
are outside the scope of the Qt API.
- \sa fromRawData(), QChar, QLatin1String, QByteArray
+ \sa fromRawData(), QChar, QStringView, QLatin1String, QByteArray
*/
/*! \typedef QString::ConstIterator
@@ -4617,8 +4617,6 @@ QString QString::section(const QRegularExpression &re, qsizetype start, qsizetyp
The entire string is returned if \a n is greater than or equal
to size(), or less than zero.
- \snippet qstring/main.cpp 31
-
\sa first(), last(), startsWith(), chopped(), chop(), truncate()
*/
QString QString::left(qsizetype n) const
@@ -4637,8 +4635,6 @@ QString QString::left(qsizetype n) const
The entire string is returned if \a n is greater than or equal
to size(), or less than zero.
- \snippet qstring/main.cpp 48
-
\sa endsWith(), last(), first(), sliced(), chopped(), chop(), truncate()
*/
QString QString::right(qsizetype n) const
@@ -4660,9 +4656,6 @@ QString QString::right(qsizetype n) const
\a n is -1 (default), the function returns all characters that
are available from the specified \a position.
- Example:
-
- \snippet qstring/main.cpp 34
\sa first(), last(), sliced(), chopped(), chop(), truncate()
*/
@@ -4695,6 +4688,8 @@ QString QString::mid(qsizetype position, qsizetype n) const
\note The behavior is undefined when \a n < 0 or \a n > size().
+ \snippet qstring/main.cpp 31
+
\sa last(), sliced(), startsWith(), chopped(), chop(), truncate()
*/
@@ -4706,6 +4701,8 @@ QString QString::mid(qsizetype position, qsizetype n) const
\note The behavior is undefined when \a n < 0 or \a n > size().
+ \snippet qstring/main.cpp 48
+
\sa first(), sliced(), endsWith(), chopped(), chop(), truncate()
*/
@@ -4719,6 +4716,8 @@ QString QString::mid(qsizetype position, qsizetype n) const
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \a pos + \a n > size().
+ \snippet qstring/main.cpp 34
+
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -4744,7 +4743,7 @@ QString QString::mid(qsizetype position, qsizetype n) const
\note The behavior is undefined if \a len is negative or greater than size().
- \sa endsWith(), left(), right(), mid(), chop(), truncate()
+ \sa endsWith(), first(), last(), sliced(), chop(), truncate()
*/
#if QT_STRINGVIEW_LEVEL < 2
@@ -5573,7 +5572,7 @@ QString QString::trimmed_helper(QString &str)
If \a position is negative, it is equivalent to passing zero.
- \sa chop(), resize(), left(), QStringView::truncate()
+ \sa chop(), resize(), first(), QStringView::truncate()
*/
void QString::truncate(qsizetype pos)
@@ -9215,7 +9214,7 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size)
\note The behavior is undefined when \a length < 0 or \a length > size().
- \sa mid(), left(), right(), chop(), truncate()
+ \sa sliced(), first(), last(), chop(), truncate()
*/
/*!
@@ -9228,7 +9227,7 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size)
\note The behavior is undefined when \a length < 0 or \a length > size().
- \sa mid(), left(), right(), chopped(), chop()
+ \sa sliced(), first(), last(), chopped(), chop()
*/
/*!
@@ -9241,7 +9240,7 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size)
\note The behavior is undefined when \a length < 0 or \a length > size().
- \sa mid(), left(), right(), chopped(), truncate()
+ \sa sliced(), first(), last(), chopped(), truncate()
*/
/*!