diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2021-10-13 16:41:24 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2021-10-21 12:38:06 +0300 |
commit | 5f038419fb927490328706d1ef73dfbbb6741124 (patch) | |
tree | dad1bd1e733834b899f7e84bca2b4e7ce7ed5f1f /src/libs/installer | |
parent | 1c5127ff073658ddedc04c0a2101549779c5d1ce (diff) |
Fix scaling of high resolution images with AspectRatioLabel
Change-Id: I1f090be53caced09db655a310a57893e13e77eab
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer')
-rw-r--r-- | src/libs/installer/aspectratiolabel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libs/installer/aspectratiolabel.cpp b/src/libs/installer/aspectratiolabel.cpp index a9af93a55..c8c3c1693 100644 --- a/src/libs/installer/aspectratiolabel.cpp +++ b/src/libs/installer/aspectratiolabel.cpp @@ -81,9 +81,11 @@ QSize AspectRatioLabel::sizeHint() const */ QPixmap AspectRatioLabel::scaledPixmap() const { - return m_pixmap.isNull() - ? QPixmap() - : m_pixmap.scaled(size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + if (m_pixmap.isNull()) + return QPixmap(); + + return m_pixmap.scaled(size() * m_pixmap.devicePixelRatio(), + Qt::KeepAspectRatio, Qt::SmoothTransformation); } /*! |