diff options
Diffstat (limited to 'src/corelib/text/qstring.cpp')
| -rw-r--r-- | src/corelib/text/qstring.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 17d1ee2deab..732b797a9bc 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -9062,8 +9062,8 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) \c{const char *} instead of QString. This includes the copy constructor, the assignment operator, the comparison operators, and various other functions such as \l{QString::insert()}{insert()}, - \l{QString::replace()}{replace()}, and \l{QString::indexOf()}{indexOf()}. - These functions are usually optimized to avoid constructing a + \l{QString::append()}{append()}, and \l{QString::prepend()}{prepend()}. + Some of these functions are optimized to avoid constructing a QString object for the \c{const char *} data. For example, assuming \c str is a QString, @@ -9076,6 +9076,12 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) because it doesn't construct four temporary QString objects and make a deep copy of the character data. + However, that is not true for all QString member functions that take + \c{const char *} and therefore applications should assume a temporary will + be created, such as in + + \snippet code/src_corelib_text_qstring.cpp 4bis + Applications that define \l QT_NO_CAST_FROM_ASCII (as explained in the QString documentation) don't have access to QString's \c{const char *} API. To provide an efficient way of specifying |
