diff options
-rw-r--r-- | src/corelib/text/qstring.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 582082a0442..40987ee3ec3 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1803,7 +1803,8 @@ void qtWarnAboutInvalidRegularExpression(const QString &pattern, const char *whe constructor. Similarly, you can pass a QString to a function that takes a \c{const char *} argument using the \l qPrintable() macro, which returns the given QString as a \c{const char *}. This is - equivalent to calling <QString>.toLocal8Bit().constData(). + equivalent to calling toLocal8Bit().\l{QByteArray::}{constData()} + on the QString. \section1 Manipulating string data @@ -2007,7 +2008,7 @@ void qtWarnAboutInvalidRegularExpression(const QString &pattern, const char *whe \snippet qstring/main.cpp 8 All functions except isNull() treat null strings the same as empty - strings. For example, toUtf8().constData() returns a valid pointer + strings. For example, toUtf8().\l{QByteArray::}{constData()} returns a valid pointer (not \nullptr) to a '\\0' character for a null string. We recommend that you always use the isEmpty() function and avoid isNull(). @@ -10272,7 +10273,7 @@ void QAbstractConcatenable::appendLatin1To(QLatin1StringView in, QChar *out) noe \relates QString Returns \a str as a \c{const char *}. This is equivalent to - \a{str}.toLocal8Bit().constData(). + \a{str}.toLocal8Bit().\l{QByteArray::}{constData()}. The char pointer will be invalid after the statement in which qPrintable() is used. This is because the array returned by @@ -10292,7 +10293,7 @@ void QAbstractConcatenable::appendLatin1To(QLatin1StringView in, QChar *out) noe \since 5.4 Returns \a str as a \c{const char *}. This is equivalent to - \a{str}.toUtf8().constData(). + \a{str}.toUtf8().\l{QByteArray::}{constData()}. The char pointer will be invalid after the statement in which qUtf8Printable() is used. This is because the array returned by |