summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 9cfbbead30..a5396bfb69 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1646,10 +1646,9 @@ const QString::Null QString::null = { };
\snippet qstring/main.cpp 8
All functions except isNull() treat null strings the same as empty
- strings. For example, toUtf8().constData() returns a pointer to a
- '\\0' character for a null string (\e not a null pointer), and
- QString() compares equal to QString(""). We recommend that you
- always use the isEmpty() function and avoid isNull().
+ strings. For example, toUtf8().constData() returns a valid pointer
+ (\e not nullptr) to a '\\0' character for a null string. We
+ recommend that you always use the isEmpty() function and avoid isNull().
\section1 Argument Formats
@@ -4466,7 +4465,7 @@ int QString::indexOf(const QRegularExpression& re, int from) const
expression \a re in the string, searching forward from index
position \a from. Returns -1 if \a re didn't match anywhere.
- If the match is successful and \a rmatch is not a null pointer, it also
+ If the match is successful and \a rmatch is not \nullptr, it also
writes the results of the match into the QRegularExpressionMatch object
pointed to by \a rmatch.
@@ -4517,7 +4516,7 @@ int QString::lastIndexOf(const QRegularExpression &re, int from) const
expression \a re in the string, which starts before the index
position \a from. Returns -1 if \a re didn't match anywhere.
- If the match is successful and \a rmatch is not a null pointer, it also
+ If the match is successful and \a rmatch is not \nullptr, it also
writes the results of the match into the QRegularExpressionMatch object
pointed to by \a rmatch.
@@ -4568,14 +4567,14 @@ bool QString::contains(const QRegularExpression &re) const
Returns \c true if the regular expression \a re matches somewhere in this
string; otherwise returns \c false.
- If the match is successful and \a match is not a null pointer, it also
+ If the match is successful and \a rmatch is not \nullptr, it also
writes the results of the match into the QRegularExpressionMatch object
- pointed to by \a match.
+ pointed to by \a rmatch.
\sa QRegularExpression::match()
*/
-bool QString::contains(const QRegularExpression &re, QRegularExpressionMatch *match) const
+bool QString::contains(const QRegularExpression &re, QRegularExpressionMatch *rmatch) const
{
if (!re.isValid()) {
qWarning("QString::contains: invalid QRegularExpression object");
@@ -4583,8 +4582,8 @@ bool QString::contains(const QRegularExpression &re, QRegularExpressionMatch *ma
}
QRegularExpressionMatch m = re.match(*this);
bool hasMatch = m.hasMatch();
- if (hasMatch && match)
- *match = std::move(m);
+ if (hasMatch && rmatch)
+ *rmatch = std::move(m);
return hasMatch;
}
@@ -10269,8 +10268,8 @@ ownership of it, no memory is freed when instances are destroyed.
/*!
\fn bool QStringRef::isNull() const
- Returns \c true if string() returns a null pointer or a pointer to a
- null string; otherwise returns \c true.
+ Returns \c true if this string reference does not reference a string or if
+ the string it references is null (i.e. QString::isNull() is true).
\sa size()
*/