oclero / qlementine

⚠️🏗️ [WORK IN PROGRESS] 🍊Modern QStyle for desktop Qt5/Qt6 applications.
https://oclero.github.io/qlementine/
MIT License
71 stars 14 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).