[docs] Fix ints that should be qsizetype [src/corelib/text]

For the constructors, replace int with qsizetype. For the incorrect
return type in \fn of length(), drop the return type, the presence of
which violated DRY, stressing the importance of that SOLID principle.

Fixes: QTBUG-103531
Change-Id: Ic7a8e1953333c28a2722fd7f753a0b5af6777395
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 334c27dad139956135b8687bf695e3cfa0228b9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2022-08-11 14:10:03 +02:00 committed by Qt Cherry-pick Bot
parent 53997b5196
commit e8e91ef35c
5 changed files with 7 additions and 7 deletions

View File

@ -38,7 +38,7 @@
When used as an interface type, QAnyStringView allows a single
function to accept a wide variety of string data sources. One
function accepting QAnyStringView thus replaces five function
overloads (taking QString, \c{(const QChar*, int)},
overloads (taking QString, \c{(const QChar*, qsizetype)},
QUtf8StringView, QLatin1StringView (but see above), and QChar), while
at the same time enabling even more string data sources to be
passed to the function, such as \c{u8"Hello World"}, a \c char8_t
@ -304,7 +304,7 @@
*/
/*!
\fn int QAnyStringView::length() const
\fn QAnyStringView::length() const
Same as size().

View File

@ -481,7 +481,7 @@
*/
/*!
\fn int QByteArrayView::length() const
\fn QByteArrayView::length() const
Same as size().

View File

@ -5610,7 +5610,7 @@ QString QString::fromUtf8(QByteArrayView ba)
host byte order is assumed.
This function is slow compared to the other Unicode conversions.
Use QString(const QChar *, int) or QString(const QChar *) if possible.
Use QString(const QChar *, qsizetype) or QString(const QChar *) if possible.
QString makes a deep copy of the Unicode data.

View File

@ -32,7 +32,7 @@ QT_BEGIN_NAMESPACE
When used as an interface type, QStringView allows a single function to accept
a wide variety of UTF-16 string data sources. One function accepting QStringView
thus replaces three function overloads (taking QString and
\c{(const QChar*, int)}), while at the same time enabling even more string data
\c{(const QChar*, qsizetype)}), while at the same time enabling even more string data
sources to be passed to the function, such as \c{u"Hello World"}, a \c char16_t
string literal.
@ -481,7 +481,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn int QStringView::length() const
\fn QStringView::length() const
Same as size().

View File

@ -473,7 +473,7 @@
*/
/*!
\fn int QUtf8StringView::length() const
\fn QUtf8StringView::length() const
Same as size().