diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-25 16:16:10 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-05-02 09:07:19 +0200 |
commit | 7d79b94db7debdd1896d1912e3052d5950b05df5 (patch) | |
tree | ec0104f8a8a14cec4ca7074d3aeb0ada78ea96e4 /src/widgets/util | |
parent | 43b779ab0462f85f9c2cce86ec2701f56306ac87 (diff) |
QtWidgets: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434
Change-Id: I310ea8f19d73a79d985ebfb8bfbff7a02c424360
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 8 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon_x11.cpp | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index d4911912d0..6ef0791ce1 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -166,6 +166,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + QCompletionModel::QCompletionModel(QCompleterPrivate *c, QObject *parent) : QAbstractProxyModel(*new QCompletionModelPrivate, parent), c(c), showAll(false) @@ -1878,9 +1880,9 @@ QStringList QCompleter::splitPath(const QString& path) const QString pathCopy = QDir::toNativeSeparators(path); #if defined(Q_OS_WIN) - if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\")) + if (pathCopy == "\\"_L1 || pathCopy == "\\\\"_L1) return QStringList(pathCopy); - const bool startsWithDoubleSlash = pathCopy.startsWith(QLatin1String("\\\\")); + const bool startsWithDoubleSlash = pathCopy.startsWith("\\\\"_L1); if (startsWithDoubleSlash) pathCopy = pathCopy.mid(2); #endif @@ -1890,7 +1892,7 @@ QStringList QCompleter::splitPath(const QString& path) const #if defined(Q_OS_WIN) if (startsWithDoubleSlash) - parts[0].prepend(QLatin1String("\\\\")); + parts[0].prepend("\\\\"_L1); #else if (pathCopy[0] == sep) // readd the "/" at the beginning as the split removed it parts[0] = u'/'; diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp index 3099b0b3e7..c4da56a08c 100644 --- a/src/widgets/util/qsystemtrayicon_x11.cpp +++ b/src/widgets/util/qsystemtrayicon_x11.cpp @@ -66,6 +66,8 @@ #ifndef QT_NO_SYSTEMTRAYICON QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static inline unsigned long locateSystemTray() { return (unsigned long)QGuiApplication::platformNativeInterface()->nativeResourceForScreen(QByteArrayLiteral("traywindow"), QGuiApplication::primaryScreen()); @@ -321,7 +323,7 @@ bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys() // no QPlatformSystemTrayIcon so fall back to default xcb platform behavior const QString platform = QGuiApplication::platformName(); - if (platform.compare(QLatin1String("xcb"), Qt::CaseInsensitive) == 0) + if (platform.compare("xcb"_L1, Qt::CaseInsensitive) == 0) return locateSystemTray(); return false; } |