<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Asking differently: How can a Qt application make sure, that KdePlatformTheme is used?</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> kde-devel <kde-devel-bounces@kde.org> on behalf of Axel Spoerl <axel.spoerl@qt.io><br>
<b>Sent:</b> Tuesday, 11 March 2025 11:46<br>
<b>To:</b> kde-devel@kde.org <kde-devel@kde.org><br>
<b>Subject:</b> Re: Re: Re: Programmatic color scheme change in QKdeTheme</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Just thinking out loud:<br>
How about adding an</div>
<pre><div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><code>extern "C" MAYBE_SOME_EXPORT QGenericUnixTheme *createTheme() { return new KdePlatformtheme(); }
</code></div></pre>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
to KdePlatformTheme?<br>
<br>
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.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
...and while at it, requestColorScheme() could also be re-implemented....</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> kde-devel <kde-devel-bounces@kde.org> on behalf of David Redondo <kde@david-redondo.de><br>
<b>Sent:</b> Tuesday, 11 March 2025 10:37<br>
<b>To:</b> kde-devel@kde.org <kde-devel@kde.org><br>
<b>Subject:</b> Re: Re: Re: Programmatic color scheme change in QKdeTheme</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">[You don't often get email from kde@david-redondo.de. Learn why this is important at
<a href="https://aka.ms/LearnAboutSenderIdentification">https://aka.ms/LearnAboutSenderIdentification</a> ]<br>
<br>
Am Dienstag, 11. März 2025, 10:10 schrieb Axel Spoerl:<br>
> Hi David,<br>
> thanks for the insight!<br>
> The program would be ideal. However, it depends on KDE libraries. If an<br>
application links to KDE anyway, it can simply use the KDE platform theme.<br>
> Users of QKdeTheme are e.g. applications that don't link to KDE, because<br>
they need to run on Gnome environments as well.<br>
> If we wanted to propagate palettes to QKdeTheme, we would have to read them<br>
directly from settings without having to link to KDE.<br>
> Cheers<br>
> Axel<br>
<br>
Heh I did not expect that Qt would start to link KColorScheme library :D. But<br>
the output could be used to make default palettes for QKDETheme.<br>
<br>
Another option would be to just read the files during runtime. I see that<br>
QKdeThemePrivate::readKdeSystemPalette already can read colors from<br>
.config/kdeglobals which contain the colors of the currently active color<br>
scheme. The color scheme files in $GenericDataLocation/color-schemes/<br>
have the same format.<br>
<br>
David<br>
<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>