From d41c841e07612c997913924dee34c6f2e00d464a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 11 Aug 2022 14:10:03 +0200 Subject: [docs] Fix ints that should be qsizetype [src/corelib/text] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Manual conflict resolutions: - qanystringview.qdoc: QLatin1StringView → QLatin1String Fixes: QTBUG-103531 Change-Id: Ic7a8e1953333c28a2722fd7f753a0b5af6777395 Reviewed-by: Sona Kurazyan Reviewed-by: Mårten Nordheim Reviewed-by: Thiago Macieira (cherry picked from commit 334c27dad139956135b8687bf695e3cfa0228b9c) --- src/corelib/text/qanystringview.qdoc | 4 ++-- src/corelib/text/qbytearrayview.qdoc | 2 +- src/corelib/text/qstring.cpp | 2 +- src/corelib/text/qstringview.cpp | 4 ++-- src/corelib/text/qutf8stringview.qdoc | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/corelib/text/qanystringview.qdoc b/src/corelib/text/qanystringview.qdoc index e73491522b..cc573bf329 100644 --- a/src/corelib/text/qanystringview.qdoc +++ b/src/corelib/text/qanystringview.qdoc @@ -62,7 +62,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, QLatin1String (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 @@ -323,7 +323,7 @@ */ /*! - \fn int QAnyStringView::length() const + \fn QAnyStringView::length() const Same as size(). diff --git a/src/corelib/text/qbytearrayview.qdoc b/src/corelib/text/qbytearrayview.qdoc index b70bb216b8..891afc5362 100644 --- a/src/corelib/text/qbytearrayview.qdoc +++ b/src/corelib/text/qbytearrayview.qdoc @@ -505,7 +505,7 @@ */ /*! - \fn int QByteArrayView::length() const + \fn QByteArrayView::length() const Same as size(). diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 373792bece..a9d3b3fe8b 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -5643,7 +5643,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. diff --git a/src/corelib/text/qstringview.cpp b/src/corelib/text/qstringview.cpp index 2d958d9348..a3f373e460 100644 --- a/src/corelib/text/qstringview.cpp +++ b/src/corelib/text/qstringview.cpp @@ -70,7 +70,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. @@ -519,7 +519,7 @@ QT_BEGIN_NAMESPACE */ /*! - \fn int QStringView::length() const + \fn QStringView::length() const Same as size(). diff --git a/src/corelib/text/qutf8stringview.qdoc b/src/corelib/text/qutf8stringview.qdoc index deac0882fe..88a41ad29f 100644 --- a/src/corelib/text/qutf8stringview.qdoc +++ b/src/corelib/text/qutf8stringview.qdoc @@ -497,7 +497,7 @@ */ /*! - \fn int QUtf8StringView::length() const + \fn QUtf8StringView::length() const Same as size(). -- cgit v1.2.3