diff options
author | Topi Reinio <topi.reinio@digia.com> | 2015-07-28 10:31:02 +0200 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@digia.com> | 2015-07-29 07:43:58 +0000 |
commit | c5461ec751b9eb8e55b80f4de125692fdf350fd7 (patch) | |
tree | 70f2768fd34cba8c1da512e1881a66e3c3c3fc30 /src | |
parent | dce90451d83d231b1b11bd1d49f885c41bb47659 (diff) |
Doc: Increase accuracy of QString documentation discussing size()
There are multiple QString and QStringRef functions that document
behavior "if n is greater than size(), ...", but a comprehensive,
correct statement is "if n is greater than or equal to size(), ...".
Change-Id: I5d2112e08013edaf6f2f6d7e8a6740ea26a076e2
Task-number: QTBUG-47479
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index ef87a8e3a5..345114d907 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -4270,8 +4270,8 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti Returns a substring that contains the \a n leftmost characters of the string. - The entire string is returned if \a n is greater than size() or - less than zero. + The entire string is returned if \a n is greater than or equal + to size(), or less than zero. \snippet qstring/main.cpp 31 @@ -4288,8 +4288,8 @@ QString QString::left(int n) const Returns a substring that contains the \a n rightmost characters of the string. - The entire string is returned if \a n is greater than size() or - less than zero. + The entire string is returned if \a n is greater than or equal + to size(), or less than zero. \snippet qstring/main.cpp 48 @@ -4956,7 +4956,8 @@ void QString::truncate(int pos) /*! Removes \a n characters from the end of the string. - If \a n is greater than size(), the result is an empty string. + If \a n is greater than or equal to size(), the result is an + empty string. Example: \snippet qstring/main.cpp 15 @@ -9315,8 +9316,8 @@ QString &QString::append(const QStringRef &str) Returns a substring reference to the \a n leftmost characters of the string. - If \a n is greater than size() or less than zero, a reference to the entire - string is returned. + If \a n is greater than or equal to size(), or less than zero, + a reference to the entire string is returned. \sa right(), mid(), startsWith() */ @@ -9333,8 +9334,8 @@ QStringRef QStringRef::left(int n) const Returns a substring reference to the \a n leftmost characters of the string. - If \a n is greater than size() or less than zero, a reference to the entire - string is returned. + If \a n is greater than or equal to size(), or less than zero, + a reference to the entire string is returned. \snippet qstring/main.cpp leftRef @@ -9354,8 +9355,8 @@ QStringRef QString::leftRef(int n) const Returns a substring reference to the \a n rightmost characters of the string. - If \a n is greater than size() or less than zero, a reference to the entire - string is returned. + If \a n is greater than or equal to size(), or less than zero, + a reference to the entire string is returned. \sa left(), mid(), endsWith() */ @@ -9372,8 +9373,8 @@ QStringRef QStringRef::right(int n) const Returns a substring reference to the \a n rightmost characters of the string. - If \a n is greater than size() or less than zero, a reference to the entire - string is returned. + If \a n is greater than or equal to size(), or less than zero, + a reference to the entire string is returned. \snippet qstring/main.cpp rightRef |