[Development] Future of Qss and QWidgets themes

PCMan pcman.tw at gmail.com
Mon Jun 23 11:01:30 CEST 2014

I'm Hong Jen Yee (nickname: pcman), a developer of LXQt desktop
We're building a classic desktop environment based on Qt, but we're
using QWidgets rather than QML. Soon we encountered the theme issues
about Qt.
For Windows and for OS X, native look & feels are wanted.
This, however, is not the case for UNIX desktop environments.
The default "fusion" style is not really customizable.
Of course apps can use qss to customize their appearance, but it's
scope is limited to one application only. It's hard to customize all
Qt apps using qss.
I can use a platform plugin to inject some qss code to every Qt apps
running in our DE to change the appearance of buttons and other
widgets, but the final results highly depend on the style plugin we

To customize the look and feel of all Qt applications, we have the
following options.
1. develop our own customizable style plugin (quite difficult)
2. inject some qss code to every app via a platform plugin (dirty,
unreliable, style plugin-dependent, unpredictable results)

In gtk+ 3, using the "adwita" theme engine, you can create a brand new
theme with css syntax and pixmaps only without writing any C code.
In Qt, creating a new theme actually means writing a new QStyle
plugin, which is non-trivial (especially for artists/designers).
Since the Qss parser and QssProxyStyle code are in place, is it
possible to make part of them public classes, so at least we can do
the following:
1. Paint some pre-defined patterns on QPainter using qss.
2. Create a generic QStyle plugin, which can be customized by users
and 3rd party developers via qss.

I understand that the focus is o Qml, but since QWidgets is very
complete and well-documented, it's still widely used and need some
more love.

Thank you.

More information about the Development mailing list