From 33f22d821fd130c97061446b375c27f2a8ae439c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 20 Jul 2023 02:35:53 +0200 Subject: [PATCH] QIconLoader: clear cache when the key becomes invalid Change-Id: I6f2745715b902ccbc87d78b1c90f6883cfdd76ae Reviewed-by: Axel Spoerl (cherry picked from commit e2f0495e7efffefe927e43b26fa3a3a610aa003f) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qiconloader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 5f6ce0bbc7d..d8a0878cc3d 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -135,8 +135,9 @@ 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++; + // Since the key has changed, we need to clear the cache as well. + QIconPrivate::clearIconCache(); } QString QIconLoader::themeName() const