QIcon: fix call to QIconEngine::scaledPixmap()

QIconEngine::scaledPixmap() takes the size in device independent pixels
and therefore it must not be multiplied by dpr here (dpr is given as a
separate argument)

This amends 245bdc8ec31755d6ab38b796014bdcab6a1d17ae.

Fixes: QTBUG-126388
Change-Id: Ib6cb5d07dd40f39749eb27bf8ed170480d10d28a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6887986bc509374995e5d838fe2a414cc23ee257)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-06-16 18:32:22 +02:00 committed by Qt Cherry-pick Bot
parent bf1d4023f3
commit 485a9213a5

View File

@ -176,8 +176,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 = scaledPixmap(pixmapSize, mode, state, dpr);
QPixmap px = scaledPixmap(rect.size(), mode, state, dpr);
painter->drawPixmap(rect, px);
}