Programmatic color scheme change in QKdeTheme

David Redondo kde at david-redondo.de
Tue Mar 11 09:37:16 GMT 2025


Am Dienstag, 11. März 2025, 10:10 schrieb Axel Spoerl:
> Hi David,
> thanks for the insight!
> The program would be ideal. However, it depends on KDE libraries. If an 
application links to KDE anyway, it can simply use the KDE platform theme.
> Users of QKdeTheme are e.g. applications that don't link to KDE, because 
they need to run on Gnome environments as well.
> If we wanted to propagate palettes to QKdeTheme, we would have to read them 
directly from settings without having to link to KDE.
> Cheers
> Axel

Heh I did not expect that Qt would start to link KColorScheme library :D. But 
the output could be used to make default palettes for QKDETheme.

Another option would be to just read the files during runtime. I see that 
QKdeThemePrivate::readKdeSystemPalette already can read colors from
.config/kdeglobals which contain the colors of the currently active color 
scheme. The color scheme files in $GenericDataLocation/color-schemes/
have the same format.

David




More information about the kde-devel mailing list