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.

Pick-to: 6.8
Change-Id: Ic93e10a81cd58fba4580c3f1522cc27e2b05cea5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-08-17 21:38:23 +02:00
parent 47ba48e024
commit ecc13e3d41

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