Programmatic color scheme change in QKdeTheme

Axel Spoerl axel.spoerl at qt.io
Mon Mar 10 15:49:30 GMT 2025


Hi KDE folks,

Qt 6.8 has implemented QPlatformTheme::requestColorScheme() as a virtual function. It is meant to allow a programmatic color scheme change within a QGuiApplication. If the system's theme is dark, the application can still be light and vice versa.
https://codereview.qt-project.org/c/qt/qtbase/+/628010 re-implements this function in QKdeTheme. In case of a deviation (requested color scheme != system color scheme), it falls back to a fusion palette (of which a dark and a light version exist).

The patch is tested, but not yet approved. I'd highly appreciate your reviews.

Cheers
Axel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20250310/ecaf2783/attachment.htm>


More information about the kde-devel mailing list