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.