[Interest] themes/styles in qml

Preet prismatic.project at gmail.com
Tue Oct 8 14:55:47 CEST 2013

> My question is whether there is any more-or-less standard way of creating
> themed applications in qml - this is actually for an in-vehicle-information
> system and we were thinking of implementing night/day modes as themes.

> My thought is to have a more or less global object with various properties,
> such as Font, BorderImage, ComboBoxStyles, and have it dynamically load up
> new styles and set the various properties from them. (this would also allow
> us to have some code generate the styles at some point if needed).

I've been working on pretty much the same thing (IVI ui) and I take a
somewhat similar approach. I create a set of reusable components that
are all dependent on a central style object which is just a QtObject
{}  with a bunch of properties and some helper functions. It has
colors, fonts, and some basic dimensions I use for components and
layouts in my QML files. It works well -- you just need to have the
style object visible to all your pages.


More information about the Interest mailing list