From 61b9195fc2764df480884a338fdeb14c8fb3aeaa Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 17 Aug 2024 21:38:23 +0200 Subject: [PATCH] QIcon::pixmap() add a note about the changed behavior With Qt6.8 QIcon::pixmap() no longer scales the size by the devicePixelRatio passed to QIconEngine::scaledPixmap(). This means that external icon engines now must be adjusted to honor this change. [ChangeLog][Important Behavior Change] QIcon::pixmap() is fixed to no longer scale the size, passed to QIconEngine::scaledPixmap(), by the devicePixelRatio. Change-Id: Ic93e10a81cd58fba4580c3f1522cc27e2b05cea5 Reviewed-by: Volker Hilsheimer (cherry picked from commit ecc13e3d41af89bd195e6f173b2c96d2295f407e) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qicon.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index cb45ce98974..0220b05d959 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -904,6 +904,10 @@ QPixmap QIcon::pixmap(const QSize &size, Mode mode, State state) const might be smaller than requested, but never larger, unless the device-pixel ratio of the returned pixmap is larger than 1. + \note Prior to Qt 6.8 this function wronlgy passed the device dependent pixmap size to + QIconEngine::scaledPixmap(), since Qt 6.8 it's the device independent size (not scaled + with the \a devicePixelRatio). + \sa actualSize(), paint() */ QPixmap QIcon::pixmap(const QSize &size, qreal devicePixelRatio, Mode mode, State state) const