From a5b9600356cb8941a2d9685975b2454837b5e6ed Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 11 Apr 2022 14:04:17 +0200 Subject: QtGui: stop using QLatin1Char constructor for creating char literals Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot Reviewed-by: Marc Mutz --- src/gui/text/qfontdatabase.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui/text/qfontdatabase.cpp') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 31ee101c13..15b69e8106 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -450,11 +450,11 @@ Q_GUI_EXPORT QFontDatabase::WritingSystem qt_writing_system_for_script(int scrip */ static void parseFontName(const QString &name, QString &foundry, QString &family) { - int i = name.indexOf(QLatin1Char('[')); - int li = name.lastIndexOf(QLatin1Char(']')); + int i = name.indexOf(u'['); + int li = name.lastIndexOf(u']'); if (i >= 0 && li >= 0 && i < li) { foundry = name.mid(i + 1, li - i - 1); - if (i > 0 && name[i - 1] == QLatin1Char(' ')) + if (i > 0 && name[i - 1] == u' ') i--; family = name.left(i); } else { @@ -497,7 +497,7 @@ static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDe QString family; family = desc.family->name; if (! desc.foundry->name.isEmpty() && desc.family->count > 1) - family += QLatin1String(" [") + desc.foundry->name + QLatin1Char(']'); + family += QLatin1String(" [") + desc.foundry->name + u']'; fontDef->families = QStringList(family); if (desc.style->smoothScalable @@ -664,7 +664,7 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFo for (int k = 0; k < foundry->count; ++k) { QString name = foundry->name.isEmpty() ? f->name - : f->name + QLatin1String(" [") + foundry->name + QLatin1Char(']'); + : f->name + QLatin1String(" [") + foundry->name + u']'; if (style == foundry->styles[k]->key.style) preferredFallbacks.append(name); else @@ -1136,9 +1136,9 @@ static QString styleStringHelper(int weight, QFont::Style style) } if (style == QFont::StyleItalic) - result += QLatin1Char(' ') + QCoreApplication::translate("QFontDatabase", "Italic"); + result += u' ' + QCoreApplication::translate("QFontDatabase", "Italic"); else if (style == QFont::StyleOblique) - result += QLatin1Char(' ') + QCoreApplication::translate("QFontDatabase", "Oblique"); + result += u' ' + QCoreApplication::translate("QFontDatabase", "Oblique"); if (result.isEmpty()) result = QCoreApplication::translate("QFontDatabase", "Normal", "The Normal or Regular font weight"); @@ -1456,7 +1456,7 @@ QStringList QFontDatabase::families(WritingSystem writingSystem) if (!foundry.isEmpty()) { str += QLatin1String(" ["); str += foundry; - str += QLatin1Char(']'); + str += u']'; } flist.append(str); } -- cgit v1.2.3