From 7b6b133746aa8bf23e08753851d7e23cc9d76170 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 11 Apr 2022 15:54:50 +0200 Subject: QtGui: use _L1 for for creating Latin-1 string literals Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne --- src/gui/image/qimage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gui/image/qimage.cpp') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 887480b873..7fd0dc424f 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -81,6 +81,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + // MSVC 19.28 does show spurious warning "C4723: potential divide by 0" for code that divides // by height() in release builds. Anyhow, all the code paths in this file are only executed // for valid QImage's, where height() cannot be 0. Therefore disable the warning. @@ -4182,7 +4184,7 @@ QString QImage::text(const QString &key) const QString tmp; for (auto it = d->text.begin(), end = d->text.end(); it != end; ++it) - tmp += it.key() + QLatin1String(": ") + it.value().simplified() + QLatin1String("\n\n"); + tmp += it.key() + ": "_L1 + it.value().simplified() + "\n\n"_L1; if (!tmp.isEmpty()) tmp.chop(2); // remove final \n\n return tmp; @@ -5707,7 +5709,7 @@ QMap qt_getImageTextFromDescription(const QString &description int index = pair.indexOf(u':'); if (index >= 0 && pair.indexOf(u' ') < index) { if (!pair.trimmed().isEmpty()) - text.insert(QLatin1String("Description"), pair.toString().simplified()); + text.insert("Description"_L1, pair.toString().simplified()); } else { const auto key = pair.left(index); if (!key.trimmed().isEmpty()) -- cgit v1.2.3