From 7d79b94db7debdd1896d1912e3052d5950b05df5 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 25 Apr 2022 16:16:10 +0200 Subject: QtWidgets: use _L1 for for creating Latin-1 string literals Task-number: QTBUG-98434 Change-Id: I310ea8f19d73a79d985ebfb8bfbff7a02c424360 Reviewed-by: Volker Hilsheimer --- src/widgets/kernel/qwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') 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()); -- cgit v1.2.3