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 <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2020-04-27 11:17:31 +02:00
parent 1337e8fe46
commit 7a8b277d5b
5 changed files with 7 additions and 7 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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) {

View File

@ -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 },

View File

@ -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];