diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-11 15:54:50 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-28 05:58:52 +0200 |
commit | 7b6b133746aa8bf23e08753851d7e23cc9d76170 (patch) | |
tree | 472044ff758e685d88618996fbccc76bbfe930b6 /src/gui/text/qtextimagehandler.cpp | |
parent | 852bb436057be518f864fb57fc1efc9d6a95f8c1 (diff) |
QtGui: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434
Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/gui/text/qtextimagehandler.cpp')
-rw-r--r-- | src/gui/text/qtextimagehandler.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp index 2872366208..e6e1d8b164 100644 --- a/src/gui/text/qtextimagehandler.cpp +++ b/src/gui/text/qtextimagehandler.cpp @@ -51,13 +51,15 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + extern QString qt_findAtNxFile(const QString &baseFileName, qreal targetDevicePixelRatio, qreal *sourceDevicePixelRatio); static inline QUrl fromLocalfileOrResources(QString path) { - if (path.startsWith(QLatin1String(":/"))) // auto-detect resources and convert them to url - path.prepend(QLatin1String("qrc")); + if (path.startsWith(":/"_L1)) // auto-detect resources and convert them to url + path.prepend("qrc"_L1); return QUrl(path); } @@ -78,13 +80,13 @@ static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format, con if (pm.isNull()) { QImage img; if (name.isEmpty() || !img.load(name)) - return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png")); + return QPixmap(":/qt-project.org/styles/commonstyle/images/file-16.png"_L1); pm = QPixmap::fromImage(img); doc->addResource(QTextDocument::ImageResource, url, pm); } - if (name.contains(QLatin1String("@2x"))) + if (name.contains("@2x"_L1)) pm.setDevicePixelRatio(sourcePixelRatio); return pm; @@ -147,7 +149,7 @@ static QImage getImage(QTextDocument *doc, const QTextImageFormat &format, const if (image.isNull()) { if (name.isEmpty() || !image.load(name)) - return QImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png")); + return QImage(":/qt-project.org/styles/commonstyle/images/file-16.png"_L1); doc->addResource(QTextDocument::ImageResource, url, image); } |