QAbstractFileIconEngine: store pixmaps with correct key

QAbstractFileIconEngine stores the generated pixmap in a QPixmapCache
with the size as key. This is wrong as the size is multiplied by the
current devicePixelRatio so this has to be done also for the key.

Pick-to: 6.9 6.8
Change-Id: I6d8ceedc950d23abf9c4d79d92e86848b9508c9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-12-25 14:22:14 +01:00
parent 348b680ae5
commit 83ff179f85

View File

@ -44,7 +44,7 @@ QPixmap QAbstractFileIconEngine::scaledPixmap(const QSize &size, QIcon::Mode mod
if (key.isEmpty())
return filePixmap(size * scale, mode, state);
key += u'_' + QString::number(size.width());
key += u'_' + QString::number(size.width() * scale);
QPixmap result;
if (!QPixmapCache::find(key, &result)) {