diff options
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 326435f28f..f7ddb5fc8e 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -3001,7 +3001,7 @@ QString &QString::operator=(QChar ch) \fn QString &QString::insert(qsizetype position, QLatin1StringView str) \overload insert() - Inserts the Latin-1 string \a str at the given index \a position. + Inserts the Latin-1 string view \a str at the given index \a position. \include qstring.cpp string-grow-at-insertion */ @@ -3027,6 +3027,24 @@ QString &QString::insert(qsizetype i, QLatin1StringView str) } /*! + \fn QString &QString::insert(qsizetype position, QUtf8StringView str) + \overload insert() + \since 6.5 + + Inserts the UTF-8 string view \a str at the given index \a position. + + \note Inserting variable-width UTF-8-encoded string data is conceptually slower + than inserting fixed-width string data such as UTF-16 (QStringView) or Latin-1 + (QLatin1StringView) and should thus be used sparingly. + + \include qstring.cpp string-grow-at-insertion +*/ +QString &QString::insert(qsizetype i, QUtf8StringView s) +{ + return insert(i, s.toString()); // ### optimize (QTBUG-108546) +} + +/*! \fn QString& QString::insert(qsizetype position, const QChar *unicode, qsizetype size) \overload insert() |