diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-04-19 20:52:19 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-04-22 20:26:51 +0200 |
commit | 896c4fe4279f7dc761dcd59f7b0cde070c38b3cb (patch) | |
tree | 1d7d2813396368bb9ea1e7ac891fb16cc23494fe /src/widgets/styles/qcommonstyle.cpp | |
parent | c6c6dc471c935761e243147d7c55c29799ce57cc (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/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 109abbefb2..b853a8e963 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -759,7 +759,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q const QString pixmapName = QStyleHelper::uniqueName("$qt_ia-"_L1 % QLatin1StringView(metaObject()->className()) % HexString<uint>(pe), - opt, QSize(size, size) * pixelRatio); + opt, QSize(size, size), pixelRatio); if (!QPixmapCache::find(pixmapName, &pixmap)) { const qreal border = pixelRatio * (size / 5.); const qreal sqsize = pixelRatio * size; |