My experience with bad example (or my understanding is that bad.)

Simple story the likes of which happens all the time where an incorrect example together with my lack of knowledge led me to the world of hurt.

In the Falkon example QML extension in order to set some basic (top level) element the original author decided to use Rectangle component (or class? or object? or whatever, I will call it component). The Rectangle component is not supposed to be used this way since it is by default also setting the background to white and thus it is not styled by the KDE theme.

This led me to believe that the QML plugins in Falkon cannot be styled by the system theme (colors in KDE systemsettings) since the background was always white even when my theme was set to dark.

Than while stalking the #kde-devel IRC channel I saw that for QML (QtQuick) when used in my window manager setup I need to set an environment variable QT_QUICK_CONTROLS_STYLE=org.kde.desktop to follow KDE settings (maybe there is a way to set this automatically outside of KDE Plasma but I was not successful at that).

Back to original thought.

The Rectangle component is probably not supposed to be used to manage layouts and there has to be better suited component to do that. So far I tried Pane which works exactly as I envisioned it to (it follows system colors set in kde system settings), maybe there is even better suited component than this which would help me even more but so far it is the best result I got from my QML journey.

So my conclusion is to use elements which are styled by Qt by default, but while I was lurking at #kde-devel IRC channel for even longer and asked more and more question I got an answer I half expected but did not like.

WARNING Next paragraph can be wrong and is recollection of how I remember it.

The KDE team recommends using Kirigami or other framework to get the colors from system theme and set them manually. This allow them a great deal of flexibility and it is also used to utilize the additional colors configurable in KDE Plasma System Settings which are not part of general Qt. But for my purpose, I do not want to burden my little extensions with a KDE library just to get some system colors.

PS: This article was postponed for many months for no good reason.

Articles from blogs I follow:

Richard Stallman's political discourse on sex

Richard Stallman, the founder of the Free Software Foundation, has been subject to numerous allegations of misconduct. He stepped down in 2019, and following his re-instatement in 2021, a famous open letter was published in which numerous organizations and i…

via Drew DeVault's blog November 25, 2023

Upgrading to FreeBSD 14 - how to fix a broken BIOS bootcode

A lot of people running ZFS zroot have managed to break their FreeBSD systems upgrading from 13.2 to the new 14.0 release because of a broken BIOS bootcode. In this tutorial I'll show you how you can fix that without having to reinstall.

via November 22, 2023

C++ Guidelines

C++ is definitely a language that has Lots of Ways to do It – kind of like Perl’s TIMTOWTSAC. A consequence is that when writing code, you need to think about which way to do things. When context-switching between projects, employers, or what-have-you, yo…

via [bobulate] November 21, 2023

Generated by openring