summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylehelper.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2024-04-19 20:52:19 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2024-04-22 20:26:51 +0200
commit896c4fe4279f7dc761dcd59f7b0cde070c38b3cb (patch)
tree1d7d2813396368bb9ea1e7ac891fb16cc23494fe /src/widgets/styles/qstylehelper.cpp
parentc6c6dc471c935761e243147d7c55c29799ce57cc (diff)
QStyleHelper: pass devicePixelRatio to uniqueName()
QStyleHelper::uniqueName() took the size of the pixmap to cache but not the dpr. This might lead to a situation (e.g. in a multi-display environment) where we use a pixmap with the wrong dpr and get a pixelated result on the screen. Change-Id: Ifdebeddff3380931398b3284a7757b7da950caa9 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Diffstat (limited to 'src/widgets/styles/qstylehelper.cpp')
-rw-r--r--src/widgets/styles/qstylehelper.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 1084761d30..02827de847 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -32,7 +32,7 @@ static inline bool usePixmapCache(const QStyleOption *opt)
return true;
}
-QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
+QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size, qreal dpr)
{
if (!usePixmapCache(option))
return {};
@@ -43,7 +43,8 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
% HexString<uint>(complexOption ? uint(complexOption->activeSubControls) : 0u)
% HexString<quint64>(option->palette.cacheKey())
% HexString<uint>(size.width())
- % HexString<uint>(size.height());
+ % HexString<uint>(size.height())
+ % HexString<qreal>(dpr);
#if QT_CONFIG(spinbox)
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {