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 <volker.hilsheimer@qt.io>
(cherry picked from commit ecc13e3d41af89bd195e6f173b2c96d2295f407e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-08-17 21:38:23 +02:00 committed by Qt Cherry-pick Bot
parent 108162274b
commit 61b9195fc2

View File

@ -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