diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-12 15:07:16 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-13 14:38:48 +0200 |
commit | 90f864a4c57c40e043978b61d85732b88dc00cc4 (patch) | |
tree | 87be890d7ce5b4c4670872c9fc90987f4abb56b5 /src/corelib/text/qstring.cpp | |
parent | 082eebe6a47c910593f87798bf688149e6ca5534 (diff) |
QString: remove op+=(char) and op+=(QChar::SpecialCharacter)
The former messes in bad ways with the overload set (it, fatally,
attracts char16_t, e.g.). The latter was probably added in response to
ambiguities between (char) and (QChar). While it's harmless now,
remove it, since it no longer pulls its weight.
The no-ascii warning is now coming from QChar(char), so the protection
isn't lost.
[ChangeLog][QtCore][QString] The += operators taking char and
QChar::SpecialCharacter have been removed as they cause adding a
char16_t to QString to call the char overload, losing information. The
append() function was not affected.
Change-Id: I57116314bcc71c0d9476159513c0c10048239db3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 077097e3fd..c74a9296dc 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -5931,22 +5931,6 @@ QString& QString::fill(QChar ch, int size) Appends the string view \a str to this string. */ -/*! \fn QString &QString::operator+=(char ch) - - \overload operator+=() - - Appends the character \a ch to this string. Note that the character is - converted to Unicode using the fromLatin1() function, unlike other 8-bit - functions that operate on UTF-8 data. - - You can disable this function by defining \c QT_NO_CAST_FROM_ASCII - when you compile your applications. This can be useful if you want - to ensure that all user-visible strings go through QObject::tr(), - for example. - - \sa QT_NO_CAST_FROM_ASCII -*/ - /*! \fn QString &QString::operator+=(QChar ch) \overload operator+=() @@ -5954,13 +5938,6 @@ QString& QString::fill(QChar ch, int size) Appends the character \a ch to the string. */ -/*! \fn QString &QString::operator+=(QChar::SpecialCharacter c) - - \overload operator+=() - - \internal -*/ - /*! \fn bool operator==(const char *s1, const QString &s2) |