Asking differently: How can a Qt application make sure, that KdePlatformTheme 
is used?
________________________________
From: kde-devel <kde-devel-boun...@kde.org> on behalf of Axel Spoerl 
<axel.spo...@qt.io>
Sent: Tuesday, 11 March 2025 11:46
To: kde-devel@kde.org <kde-devel@kde.org>
Subject: Re: Re: Re: Programmatic color scheme change in QKdeTheme

Just thinking out loud:
How about adding an

extern "C" MAYBE_SOME_EXPORT QGenericUnixTheme *createTheme() { return new 
KdePlatformtheme(); }


to KdePlatformTheme?

We could then try to load the KDE library at runtine in 
QKdeTheme::createKdeTheme(). If we can resolve the symbol, an application that 
doesn't even know from KDE could benefit from KdePlatformTheme.
...and while at it, requestColorScheme() could also be re-implemented....
________________________________
From: kde-devel <kde-devel-boun...@kde.org> on behalf of David Redondo 
<k...@david-redondo.de>
Sent: Tuesday, 11 March 2025 10:37
To: kde-devel@kde.org <kde-devel@kde.org>
Subject: Re: Re: Re: Programmatic color scheme change in QKdeTheme

[You don't often get email from k...@david-redondo.de. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

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


Reply via email to