QML Styling
-
Can anyone provide any pointers to guidance on how to implement styling/theming in a QML application.
I am aware of https://wiki.qt.io/Qml_Styling but it has not substantially changed since 2015. Is this still good advice?
What I am trying to achieve is to apply some colours in a consistent manner across my application according to a theme that I have been asked to use. Furthermore, a light and dark version of the theme exist. The application currently uses colour in a rather ad hoc way so it is going to take some work, but I need a plan of how to get there. Is the use of a style singleton as in the link above considered to be a reasonable approach?
Other than that article, I am also aware of the built-in styles but I have never figured out when it is appropriate to use them. Whenever I experimentally switched styles from the default one I am using, everything just looks like a mess. Unfortunately, I have to use
TreeViewfrom Controls 1, and I have my own customisations of various controls. I suspect that neither of these things play nicely with the built-in styles, but there is so little discussion anywhere that I don't know what to expect.I believe the built-in styles are implemented using the
Qt Quick Templates 2module. Is one supposed to use this to make one's own style and is that considered to be a better/more modern approach than the style singleton approach? Again, I am struggling to find any useful information.