From d535dedf6038d8e4aff05d2389c3ac1bc7f27ceb Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Fri, 30 Sep 2022 00:24:04 +0800 Subject: [PATCH] fix: image blurry on Hi-DPI devices --- app/graphicsview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/graphicsview.cpp b/app/graphicsview.cpp index 48d2ca7..f4b8f60 100644 --- a/app/graphicsview.cpp +++ b/app/graphicsview.cpp @@ -60,11 +60,12 @@ void GraphicsView::showFileFromPath(const QString &filePath, bool doRequestGalle doRequestGallery = false; showText(tr("Image data is invalid or currently unsupported")); } else { - const QPixmap & pixmap = QPixmap::fromImageReader(&imageReader); + QPixmap && pixmap = QPixmap::fromImageReader(&imageReader); if (pixmap.isNull()) { doRequestGallery = false; showText(tr("Image data is invalid or currently unsupported")); } else { + pixmap.setDevicePixelRatio(devicePixelRatioF()); showImage(pixmap); } }