diff options
author | Bastien Bouclet <bastien.bouclet@gmail.com> | 2021-01-22 11:14:22 +0100 |
---|---|---|
committer | Bastien Bouclet <bastien.bouclet@gmail.com> | 2021-01-29 14:18:42 +0100 |
commit | b61275ee72ae2a895dee3652aca886859962cdb2 (patch) | |
tree | 4a9046a5c894cd5ecfe7570575293d87e3e8ea2d /src/gui | |
parent | 6e7628821dc4cb3b4f1a6356bbe839e94c58a81f (diff) |
QIcon: Use the @nx pixmaps in the paint method
Make use of the device pixel ratio in the QIcon paint method so the @nx
hi-dpi pixmaps are selected when appropriate when painting to a
QPainter.
Fixes: QTBUG-90042
Change-Id: I53995a2285ef879e3c4fddb9f8da702e256a260f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b69b04c4790f319104a1098147cea9405b6e7062)
Reviewed-by: Bastien Bouclet <bastien.bouclet@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qicon.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index fdb2ab0f9b..4f31414e10 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -174,7 +174,7 @@ void QPixmapIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode auto paintDevice = painter->device(); qreal dpr = paintDevice ? paintDevice->devicePixelRatio() : qApp->devicePixelRatio(); const QSize pixmapSize = rect.size() * dpr; - QPixmap px = pixmap(pixmapSize, mode, state); + QPixmap px = scaledPixmap(pixmapSize, mode, state, dpr); painter->drawPixmap(rect, px); } |