diff options
author | Marc Mutz <[email protected]> | 2020-04-27 11:17:31 +0200 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2020-04-30 00:30:57 +0200 |
commit | 7a8b277d5bcfd3597b6634e0402ac5f7202d9b71 (patch) | |
tree | b11a82c51198bff3b817085aa4378dea976d9e24 | |
parent | 1337e8fe46ac7934f80b8a95b84b5cb61707f8e4 (diff) |
QtGui: fix a few more char/int/uint -> QChar conversions
They were masked by all QChar ctors being made explicit, except the
char16_t one, which was left as the only viable choice.
Change-Id: I343269b61d555c259b5780011e99f85f5375ef78
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qrangecollection.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qfontengine.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 2 | ||||
-rw-r--r-- | src/gui/util/qhexstring_p.h | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 93fd59e53f6..04eaddd6df4 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -750,7 +750,7 @@ QString QPlatformTheme::defaultStandardButtonText(int button) QString QPlatformTheme::removeMnemonics(const QString &original) { - QString returnText(original.size(), 0); + QString returnText(original.size(), u'\0'); int finalDest = 0; int currPos = 0; int l = original.length(); diff --git a/src/gui/painting/qrangecollection.cpp b/src/gui/painting/qrangecollection.cpp index 9acb36a000f..5fd4ebaa4b2 100644 --- a/src/gui/painting/qrangecollection.cpp +++ b/src/gui/painting/qrangecollection.cpp @@ -156,7 +156,7 @@ void QRangeCollection::clear() bool QRangeCollection::parse(const QString &ranges) { Q_D(QRangeCollection); - const QStringList items = ranges.split(','); + const QStringList items = ranges.split(u','); for (const QString &item : items) { if (item.isEmpty()) { d->intervals.clear(); @@ -164,7 +164,7 @@ bool QRangeCollection::parse(const QString &ranges) } if (item.contains(QLatin1Char('-'))) { - const QStringList rangeItems = item.split('-'); + const QStringList rangeItems = item.split(u'-'); if (rangeItems.count() != 2) { d->intervals.clear(); return false; diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 1269aefbf2b..c260c06fe44 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1834,12 +1834,12 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len, int lastFallback = -1; while (it.hasNext()) { - const uint ucs4 = it.peekNext(); + const char32_t ucs4 = it.peekNext(); // If we applied a fallback font to previous glyph, and the current is either // ZWJ or ZWNJ, we should also try applying the same fallback font to that, in order // to get the correct shaping rules applied. - if (lastFallback >= 0 && (ucs4 == QChar(0x200d) || ucs4 == QChar(0x200c))) { + if (lastFallback >= 0 && (ucs4 == 0x200d || ucs4 == 0x200c)) { QFontEngine *engine = m_engines.at(lastFallback); glyph_t glyph = engine->glyphIndex(ucs4); if (glyph != 0) { diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 76ff99aae01..0c8a29c6bed 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE // see also tst_qtextdocumentfragment.cpp #define MAX_ENTITY 258 -static const struct QTextHtmlEntity { const char name[9]; quint16 code; } entities[]= { +static const struct QTextHtmlEntity { const char name[9]; char16_t code; } entities[]= { { "AElig", 0x00c6 }, { "AMP", 38 }, { "Aacute", 0x00c1 }, diff --git a/src/gui/util/qhexstring_p.h b/src/gui/util/qhexstring_p.h index d30a8eeee87..2afbf3a42b3 100644 --- a/src/gui/util/qhexstring_p.h +++ b/src/gui/util/qhexstring_p.h @@ -69,7 +69,7 @@ template <typename T> inline void write(QChar *&dest) const { - const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + const char16_t hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; const char *c = reinterpret_cast<const char *>(&val); for (uint i = 0; i < sizeof(T); ++i) { *dest++ = hexChars[*c & 0xf]; |