From e6fd3726f128c0ba5b67ce25d328060a358690bd Mon Sep 17 00:00:00 2001 From: kleuter Date: Mon, 12 Oct 2020 20:49:59 +0200 Subject: [PATCH] 5.15.1: fix for QTBUG-52697 --- 5.15.1/qtbase/src/gui/text/qtextimagehandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/5.15.1/qtbase/src/gui/text/qtextimagehandler.cpp b/5.15.1/qtbase/src/gui/text/qtextimagehandler.cpp index 0d87a21..15eab64 100644 --- a/5.15.1/qtbase/src/gui/text/qtextimagehandler.cpp +++ b/5.15.1/qtbase/src/gui/text/qtextimagehandler.cpp @@ -87,6 +87,10 @@ static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format, con QUrl url = QUrl(name); qreal sourcePixelRatio = 1.0; name = resolveFileName(name, &url, devicePixelRatio, &sourcePixelRatio); + + if (name.contains(QLatin1String("@2x"))) + url = QUrl(name); // url must be updated! (QTBUG-52697) + const QVariant data = doc->resource(QTextDocument::ImageResource, url); if (data.userType() == QMetaType::QPixmap || data.userType() == QMetaType::QImage) { pm = qvariant_cast(data); @@ -169,6 +173,10 @@ static QImage getImage(QTextDocument *doc, const QTextImageFormat &format, const QUrl url = QUrl(name); qreal sourcePixelRatio = 1.0; name = resolveFileName(name, &url, devicePixelRatio, &sourcePixelRatio); + + if (name.contains(QLatin1String("@2x"))) + url = QUrl(name); // url must be updated! (QTBUG-52697) + const QVariant data = doc->resource(QTextDocument::ImageResource, url); if (data.userType() == QMetaType::QImage) { image = qvariant_cast(data);