From be509449b68cb6316081abcc96697d8b8396bdee Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Mon, 13 May 2024 20:12:32 +0200 Subject: [PATCH] QIcon: Adjust documentation of QIcon::pixmap() The documentation of QIcon::pixmap() taking a devicePixelRatio could be read in the way that a QPixmap of the requested size and devicePixelRatio is generated which is not true. The generation part is only valid for the given mode and state. Pick-to: 6.5 Change-Id: I5374cd7be17c32cd87d7b35552e60a4c07ebe6b2 Reviewed-by: Samuel Gaist Reviewed-by: Axel Spoerl (cherry picked from commit 2422f8b18dd325e5ac7d0adff39b2c93a8f75466) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qicon.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 008497a04ef..1bea0662b9a 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -859,7 +859,9 @@ QPixmap QIcon::pixmap(const QSize &size, Mode mode, State state) const \since 6.0 Returns a pixmap with the requested \a size, \a devicePixelRatio, \a mode, and \a - state, generating one if necessary. + state, generating one with the given \a mode and \a state if necessary. The pixmap + might be smaller than requested, but never larger, unless the device-pixel ratio + of the returned pixmap is larger than 1. \sa actualSize(), paint() */