From 7ab0bcbf8ea85f10c130217db64dd872b3cf76b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 15 Jun 2023 14:54:01 +0200 Subject: [PATCH] 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. Change-Id: Ie3bca00a9146d1f429b2a6f8ab0b39e15834d158 Reviewed-by: Axel Spoerl (cherry picked from commit 4dacaaf15a51860f3a7a2d72ca033ccc38165de1) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qiconloader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 603a9d94cd1..629d59d535e 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -137,9 +137,10 @@ void QIconLoader::updateSystemTheme() 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++; - - QIconPrivate::clearIconCache(); } QString QIconLoader::themeName() const