Skip clearing the QIcon cache on QIconLoader theme key change

QThemeIconEngine takes care of creating a new icon engine when
the icon theme key changes, so we don't need to invalidate the
entire QIcon cache.

Pick-to: 6.6
Change-Id: Ie3bca00a9146d1f429b2a6f8ab0b39e15834d158
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-06-15 14:54:01 +02:00
parent 331f316b91
commit 4dacaaf15a

View File

@ -133,9 +133,10 @@ void QIconLoader::updateSystemTheme()
void QIconLoader::invalidateKey() void QIconLoader::invalidateKey()
{ {
// Invalidating the key here will result in QThemeIconEngine
// recreating the actual engine the next time the icon is used.
// We don't need to clear the QIcon cache itself.
m_themeKey++; m_themeKey++;
QIconPrivate::clearIconCache();
} }
QString QIconLoader::themeName() const QString QIconLoader::themeName() const