diff options
author | Mate Barany <mate.barany@qt.io> | 2022-11-16 15:48:53 +0100 |
---|---|---|
committer | Mate Barany <mate.barany@qt.io> | 2022-12-02 16:04:11 +0100 |
commit | f046589e1408863d954263ac941c51aa3b638948 (patch) | |
tree | ac6bb2fe9472584e705b9cdc8452f9b5c07fb1ec /src/corelib/text/qstring.h | |
parent | 2ffdb3bcddb2528c95571f7eaee270c5d56ab13d (diff) |
QString: overload insert with QUtf8StringView
Overloading insert is a bit tricky since the size might change after
the conversion so either the tail has to be moved twice or a temporary
buffer is needed. For now, add an ineffective but simple overload as in
the case of the const char *s overload, and do the performance
optimization in a follow-up task (QTBUG-108546).
[ChangeLog][QtCore][QString] Added insert(QUtf8StringView) overload.
Task-number: QTBUG-103302
Change-Id: If01c216ff626da29abb43eb68d4de82824f3bfba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r-- | src/corelib/text/qstring.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 16ab13e1e9..a6cc1cf867 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -687,6 +687,7 @@ public: inline QString &insert(qsizetype i, const QString &s) { return insert(i, s.constData(), s.size()); } inline QString &insert(qsizetype i, QStringView v) { return insert(i, v.data(), v.size()); } QString &insert(qsizetype i, QLatin1StringView s); + QString &insert(qsizetype i, QUtf8StringView s); QString &append(QChar c); QString &append(const QChar *uc, qsizetype len); |