Qt: Menu icons need to be colorized
Menus can be dark or light. For example, the new Windows 11 modern style makes the menu really dark or light, in that case black icons can not be seen.
QIcon
does not seem to have support for that, same situation with the SVG icon engine.
I'm not really keen on using the SVG colorizer (SVGColorImageReader
) and creating an icon from a pixmap, because that means forfeiting most if not all of the optimizations that a QIconEngine
is capable of doing. And it is also not a good idea to re-implement the SVG icon engine (QSvgIconEngine
). There must be a better way, maybe with QProxyStyle
to intercept drawing the icon in the menu.