summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-25 16:16:10 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-05-02 09:07:19 +0200
commit7d79b94db7debdd1896d1912e3052d5950b05df5 (patch)
treeec0104f8a8a14cec4ca7074d3aeb0ada78ea96e4 /src/widgets/kernel/qwidget.cpp
parent43b779ab0462f85f9c2cce86ec2701f56306ac87 (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/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 2adbffa99b..d3a742acea 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -119,6 +119,7 @@
QT_BEGIN_NAMESPACE
using namespace QNativeInterface::Private;
+using namespace Qt::StringLiterals;
Q_LOGGING_CATEGORY(lcWidgetPainting, "qt.widgets.painting", QtWarningMsg);
@@ -6021,7 +6022,7 @@ QString QWidget::windowTitle() const
if (!d->extra->topextra->caption.isEmpty())
return d->extra->topextra->caption;
if (!d->extra->topextra->filePath.isEmpty())
- return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]");
+ return QFileInfo(d->extra->topextra->filePath).fileName() + "[*]"_L1;
}
return QString();
}
@@ -6045,7 +6046,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
if (cap.isEmpty())
return cap;
- QLatin1String placeHolder("[*]");
+ const auto placeHolder = "[*]"_L1;
int index = cap.indexOf(placeHolder);
// here the magic begins
@@ -6069,7 +6070,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
index = cap.indexOf(placeHolder, index);
}
- cap.replace(QLatin1String("[*][*]"), placeHolder);
+ cap.replace("[*][*]"_L1, placeHolder);
return cap;
}
@@ -11456,7 +11457,7 @@ void QWidgetPrivate::setWindowModified_helper()
return;
bool on = q->testAttribute(Qt::WA_WindowModified);
if (!platformWindow->setWindowModified(on)) {
- if (Q_UNLIKELY(on && !q->windowTitle().contains(QLatin1String("[*]"))))
+ if (Q_UNLIKELY(on && !q->windowTitle().contains("[*]"_L1)))
qWarning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder");
setWindowTitle_helper(q->windowTitle());
setWindowIconText_helper(q->windowIconText());