mirror of
https://github.com/crystalidea/qt-build-tools.git
synced 2024-11-26 04:31:39 +08:00
5.15.1: fix for QTBUG-52697
This commit is contained in:
parent
26e93867d0
commit
e6fd3726f1
@ -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<QPixmap>(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<QImage>(data);
|
||||
|
Loading…
Reference in New Issue
Block a user