summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qaction.cpp4
-rw-r--r--src/gui/kernel/qguiapplication.cpp10
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp2
-rw-r--r--src/gui/kernel/qinternalmimedata.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.cpp30
-rw-r--r--src/gui/kernel/qpalette.cpp4
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp4
-rw-r--r--src/gui/kernel/qplatforminputcontextfactory.cpp2
-rw-r--r--src/gui/kernel/qplatformtheme.cpp10
-rw-r--r--src/gui/kernel/qplatformthemefactory.cpp2
10 files changed, 35 insertions, 35 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 2d8d289c98..2992700269 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -66,7 +66,7 @@ static QString qt_strippedText(QString s)
{
s.remove(QLatin1String("..."));
for (int i = 0; i < s.size(); ++i) {
- if (s.at(i) == QLatin1Char('&'))
+ if (s.at(i) == u'&')
s.remove(i, 1);
}
return s.trimmed();
@@ -654,7 +654,7 @@ QString QAction::text() const
QString s = d->text;
if (s.isEmpty()) {
s = d->iconText;
- s.replace(QLatin1Char('&'), QLatin1String("&&"));
+ s.replace(u'&', QLatin1String("&&"));
}
return s;
}
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 119c57ac19..8c9bb75844 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1205,12 +1205,12 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString
<< "platformPluginPath" << platformPluginPath
<< "platformThemeName" << platformThemeName;
- QStringList plugins = pluginNamesWithArguments.split(QLatin1Char(';'), Qt::SkipEmptyParts);
+ QStringList plugins = pluginNamesWithArguments.split(u';', Qt::SkipEmptyParts);
QStringList platformArguments;
QStringList availablePlugins = QPlatformIntegrationFactory::keys(platformPluginPath);
for (const auto &pluginArgument : plugins) {
// Split into platform name and arguments
- QStringList arguments = pluginArgument.split(QLatin1Char(':'), Qt::SkipEmptyParts);
+ QStringList arguments = pluginArgument.split(u':', Qt::SkipEmptyParts);
if (arguments.isEmpty())
continue;
const QString name = arguments.takeFirst().toLower();
@@ -1314,7 +1314,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString
if (!platformArguments.isEmpty()) {
if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()) {
for (const QString &argument : qAsConst(platformArguments)) {
- const int equalsPos = argument.indexOf(QLatin1Char('='));
+ const int equalsPos = argument.indexOf(u'=');
const QByteArray name =
equalsPos != -1 ? argument.left(equalsPos).toUtf8() : argument.toUtf8();
const QVariant value =
@@ -1591,7 +1591,7 @@ void QGuiApplicationPrivate::init()
QString qbundlePath = QCFString(CFURLCopyFileSystemPath(bundleURL,
kCFURLPOSIXPathStyle));
if (qbundlePath.endsWith(QLatin1String(".app")))
- QDir::setCurrent(qbundlePath.section(QLatin1Char('/'), 0, -2));
+ QDir::setCurrent(qbundlePath.section(u'/', 0, -2));
}
#endif
#ifndef QT_NO_SESSIONMANAGER
@@ -1599,7 +1599,7 @@ void QGuiApplicationPrivate::init()
++i;
if (argv[i] && *argv[i]) {
session_id = QString::fromLatin1(argv[i]);
- int p = session_id.indexOf(QLatin1Char('_'));
+ int p = session_id.indexOf(u'_');
if (p >= 0) {
session_key = session_id.mid(p +1);
session_id = session_id.left(p);
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index e8b704ff79..e77834eab8 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -714,7 +714,7 @@ QVector<QHighDpiScaling::ScreenFactor> QHighDpiScaling::parseScreenScaleFactorsS
// - a semicolon-separated name=factor list: "foo=1.5;bar=2;baz=3"
const auto specs = screenScaleFactors.split(u';');
for (const auto &spec : specs) {
- const int equalsPos = spec.lastIndexOf(QLatin1Char('='));
+ const int equalsPos = spec.lastIndexOf(u'=');
if (equalsPos == -1) {
// screens in order
bool ok;
diff --git a/src/gui/kernel/qinternalmimedata.cpp b/src/gui/kernel/qinternalmimedata.cpp
index 5dc296cd01..6a2d7a7cbf 100644
--- a/src/gui/kernel/qinternalmimedata.cpp
+++ b/src/gui/kernel/qinternalmimedata.cpp
@@ -225,7 +225,7 @@ QByteArray QInternalMimeData::renderDataHelper(const QString &mimeType, const QM
QImage image = qvariant_cast<QImage>(data->imageData());
QBuffer buf(&ba);
buf.open(QBuffer::WriteOnly);
- image.save(&buf, mimeType.mid(mimeType.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper());
+ image.save(&buf, mimeType.mid(mimeType.indexOf(u'/') + 1).toLatin1().toUpper());
}
}
}
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index e8a6225fd7..df874ec198 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -970,10 +970,10 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
bool found = false;
int p = 0;
while (p >= 0) {
- p = text.indexOf(QLatin1Char('&'), p) + 1;
+ p = text.indexOf(u'&', p) + 1;
if (p <= 0 || p >= (int)text.length())
break;
- if (text.at(p) != QLatin1Char('&')) {
+ if (text.at(p) != u'&') {
QChar c = text.at(p);
if (c.isPrint()) {
if (!found) {
@@ -1029,14 +1029,14 @@ int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format)
// We MUST use something to separate each sequence, and space
// does not cut it, since some of the key names have space
// in them.. (Let's hope no one translate with a comma in it:)
- p = keyseq.indexOf(QLatin1Char(','));
+ p = keyseq.indexOf(u',');
if (-1 != p) {
if (p == keyseq.length() - 1) { // Last comma 'Ctrl+,'
p = -1;
} else {
- if (QLatin1Char(',') == keyseq.at(p+1)) // e.g. 'Ctrl+,, Shift+,,'
+ if (u',' == keyseq.at(p+1)) // e.g. 'Ctrl+,, Shift+,,'
p++;
- if (QLatin1Char(' ') == keyseq.at(p+1)) { // Space after comma
+ if (u' ' == keyseq.at(p+1)) { // Space after comma
diff = 1;
p++;
} else {
@@ -1117,11 +1117,11 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
QList<QModifKeyName> modifs;
if (nativeText) {
- modifs << QModifKeyName(Qt::CTRL, QCoreApplication::translate("QShortcut", "Ctrl").toLower().append(QLatin1Char('+')))
- << QModifKeyName(Qt::SHIFT, QCoreApplication::translate("QShortcut", "Shift").toLower().append(QLatin1Char('+')))
- << QModifKeyName(Qt::ALT, QCoreApplication::translate("QShortcut", "Alt").toLower().append(QLatin1Char('+')))
- << QModifKeyName(Qt::META, QCoreApplication::translate("QShortcut", "Meta").toLower().append(QLatin1Char('+')))
- << QModifKeyName(Qt::KeypadModifier, QCoreApplication::translate("QShortcut", "Num").toLower().append(QLatin1Char('+')));
+ modifs << QModifKeyName(Qt::CTRL, QCoreApplication::translate("QShortcut", "Ctrl").toLower().append(u'+'))
+ << QModifKeyName(Qt::SHIFT, QCoreApplication::translate("QShortcut", "Shift").toLower().append(u'+'))
+ << QModifKeyName(Qt::ALT, QCoreApplication::translate("QShortcut", "Alt").toLower().append(u'+'))
+ << QModifKeyName(Qt::META, QCoreApplication::translate("QShortcut", "Meta").toLower().append(u'+'))
+ << QModifKeyName(Qt::KeypadModifier, QCoreApplication::translate("QShortcut", "Num").toLower().append(u'+'));
}
modifs += *gmodifs; // Test non-translated ones last
@@ -1141,7 +1141,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
int i = 0;
int lastI = 0;
- while ((i = sl.indexOf(QLatin1Char('+'), i + 1)) != -1) {
+ while ((i = sl.indexOf(u'+', i + 1)) != -1) {
const QStringView sub = QStringView{sl}.mid(lastI, i - lastI + 1);
// If we get here the shortcuts contains at least one '+'. We break up
// along the following strategy:
@@ -1154,7 +1154,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
// Only '+' can have length 1.
if (sub.length() == 1) {
// Make sure we only encounter a single '+' at the end of the accel
- if (accel.lastIndexOf(QLatin1Char('+')) != accel.length()-1)
+ if (accel.lastIndexOf(u'+') != accel.length()-1)
return Qt::Key_unknown;
} else {
// Identify the modifier
@@ -1174,7 +1174,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
lastI = i + 1;
}
- int p = accel.lastIndexOf(QLatin1Char('+'), accel.length() - 2); // -2 so that Ctrl++ works
+ int p = accel.lastIndexOf(u'+', accel.length() - 2); // -2 so that Ctrl++ works
QStringView accelRef(accel);
if (p > 0)
accelRef = accelRef.mid(p + 1);
@@ -1190,7 +1190,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
{
ret |= accelRef.at(0).toUpper().unicode();
}
- } else if (accelRef.at(0) == QLatin1Char('f') && (fnum = accelRef.mid(1).toInt()) >= 1 && fnum <= 35) {
+ } else if (accelRef.at(0) == u'f' && (fnum = accelRef.mid(1).toInt()) >= 1 && fnum <= 35) {
ret |= Qt::Key_F1 + fnum - 1;
} else {
// For NativeText, check the translation table first,
@@ -1237,7 +1237,7 @@ static inline void addKey(QString &str, const QString &theKey, QKeySequence::Seq
//: Key separator in shortcut string
str += QCoreApplication::translate("QShortcut", "+");
} else {
- str += QLatin1Char('+');
+ str += u'+';
}
}
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 1ce611ce21..22ba5f3bcd 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -1220,8 +1220,8 @@ static QString groupsToString(const QPalette &p, QPalette::ColorRole cr)
if (p.isBrushSet(cg, cr)) {
const auto &color = p.color(cg, cr);
- groupString += QString::fromUtf8(groupEnum.valueToKey(cg)) + QLatin1Char(':') +
- color.name(QColor::HexArgb) + QLatin1Char(',');
+ groupString += QString::fromUtf8(groupEnum.valueToKey(cg)) + u':' +
+ color.name(QColor::HexArgb) + u',';
}
}
groupString.chop(1);
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 1a7e1d626b..1c20253cd0 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -648,7 +648,7 @@ QStringList QFileDialogOptions::mimeTypeFilters() const
void QFileDialogOptions::setDefaultSuffix(const QString &suffix)
{
d->defaultSuffix = suffix;
- if (d->defaultSuffix.size() > 1 && d->defaultSuffix.startsWith(QLatin1Char('.')))
+ if (d->defaultSuffix.size() > 1 && d->defaultSuffix.startsWith(u'.'))
d->defaultSuffix.remove(0, 1); // Silently change ".txt" -> "txt".
}
@@ -782,7 +782,7 @@ QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter)
QRegularExpressionMatch match = regexp.match(filter);
if (match.hasMatch())
f = match.captured(2);
- return f.split(QLatin1Char(' '), Qt::SkipEmptyParts);
+ return f.split(u' ', Qt::SkipEmptyParts);
#else
Q_UNUSED(filter);
return QStringList();
diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp
index 749abaf27a..27edcea290 100644
--- a/src/gui/kernel/qplatforminputcontextfactory.cpp
+++ b/src/gui/kernel/qplatforminputcontextfactory.cpp
@@ -72,7 +72,7 @@ QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
{
#if QT_CONFIG(settings)
if (!key.isEmpty()) {
- QStringList paramList = key.split(QLatin1Char(':'));
+ QStringList paramList = key.split(u':');
const QString platform = paramList.takeFirst().toLower();
QPlatformInputContext *ic = qLoadPlugin<QPlatformInputContext, QPlatformInputContextPlugin>
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index b93e44c214..5dbc24c07d 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -765,15 +765,15 @@ QString QPlatformTheme::removeMnemonics(const QString &original)
int currPos = 0;
int l = original.length();
while (l) {
- if (original.at(currPos) == QLatin1Char('&')) {
+ if (original.at(currPos) == u'&') {
++currPos;
--l;
if (l == 0)
break;
- } else if (original.at(currPos) == QLatin1Char('(') && l >= 4 &&
- original.at(currPos + 1) == QLatin1Char('&') &&
- original.at(currPos + 2) != QLatin1Char('&') &&
- original.at(currPos + 3) == QLatin1Char(')')) {
+ } else if (original.at(currPos) == u'(' && l >= 4 &&
+ original.at(currPos + 1) == u'&' &&
+ original.at(currPos + 2) != u'&' &&
+ original.at(currPos + 3) == u')') {
/* remove mnemonics its format is "\s*(&X)" */
int n = 0;
while (finalDest > n && returnText.at(finalDest - n - 1).isSpace())
diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp
index 0d7163cdd4..24ea467ee0 100644
--- a/src/gui/kernel/qplatformthemefactory.cpp
+++ b/src/gui/kernel/qplatformthemefactory.cpp
@@ -53,7 +53,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath)
{
- QStringList paramList = key.split(QLatin1Char(':'));
+ QStringList paramList = key.split(u':');
const QString platform = paramList.takeFirst().toLower();
loader->setExtraSearchPath(platformPluginPath);
return qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList);