oclero / qlementine

⚠️🏗️ [WORK IN PROGRESS] 🍊Modern QStyle for desktop Qt6 applications.
https://oclero.github.io/qlementine/
MIT License
73 stars 16 forks source link

When switching theme, update `QPixmapCache` #28

Open oclero opened 1 year ago

oclero commented 1 year ago

Issue

When switching theme, some icons don't change: those that are created in some QWidget's constructors and set once for all.

Solution

Qt stores all images in QPixmapCache and the key for a given QPixmap is documented (it's a combination of size and more properties). The idea is to replace the QPixmaps directly in the cache by correctly colorized ones (according to theme colors).