diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-04-28 12:52:19 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-05-08 12:48:32 +0000 |
commit | 69f6cab0af78285472deb8d91c862c600685e618 (patch) | |
tree | 86df032204ac028dae8bc3ebe190e198e432444f /src/corelib/tools/qstring.cpp | |
parent | a5725561da44215e43b808732ad22fdca4d91454 (diff) |
Doc: replace even more null/0/nullptr with \nullptr macro
Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also
checked for 'null pointer' and similar.
Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index a123aa8e75..ee9d486eb8 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1685,10 +1685,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 @@ -4553,7 +4552,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. @@ -4604,7 +4603,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. @@ -4655,14 +4654,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"); @@ -4670,8 +4669,8 @@ bool QString::contains(const QRegularExpression &re, QRegularExpressionMatch *ma } QRegularExpressionMatch m = re.match(*this); bool hasMatch = m.hasMatch(); - if (hasMatch && match) - *match = qMove(m); + if (hasMatch && rmatch) + *rmatch = qMove(m); return hasMatch; } @@ -10333,8 +10332,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() */ |