[Development] Dark mode, palettes, styles etc.

Uwe Rathmann Uwe.Rathmann at tigertal.de
Mon Jul 9 16:01:17 CEST 2018


On Fri, 06 Jul 2018 08:50:44 +0000, Shawn Rutledge wrote:

> But there’s the
> trend of using image-based styles more, which contributes to the
> annoyance that you don’t actually have system-wide control over colors
> and styles.

At least for Qt/Quick I'm not sure if this a trend Qt has created by not 
providing powerful scene graph nodes to the user.

F.e. one of the very first thing I did was to implement my own type of 
renderer for rectangles, so that I can do raised/sunken effects with 
rounded borders and vertical gradients.

( The frames/boxes examples in qskinny show those nodes - quality will be 
better once Qt-antialising has been added ).

Also because Qt/Quick applications are often in fullscreen mode only 
proper layouting - like it is state of the art with widgets since decades 
- is not that common anymore. And again Qt/Quick has a responsibility in 
this as its layouts are not on the same level - even if having a powerful 
engine below.

> So it just becomes more work for widgets, controls and
> applications to have both sets of images, in addition to having
> different resolutions for high-dpi support, whenever they are built that
> way.

I remember that once there was a page in the Qt/docs that recommended 
using layouts and vector graphic formats. Unfortunately Qt was never good 
at vector graphic formats - neither for widgets nor Quick.

( Actually this would be a wish for Qt 6 I would have )

FYI our application is completely made of SVGs ( more than 1000 different 
) that work with different screen resolutions and color schemes.

We are precompiling our SVGs into a painter commands at build time.
Then the different colors inside those painter commands are replaced at 
runtime from the themes ( = skins in our terminology ).

As our icons are simple and are made of few colors only, rendering them 
to textures is fast and we are able to interpolate between the colors for 
animated theme transitions without losing frames.

( The svgviewer example of qskinny shows it - our real application has 
this smooth transitions between skins for all controls ).

> (So much
> so that Shapes are a really recent addition, while Canvas and QtSVG
> continue to use QPainter to render to a texture.)

In the beginning of our project I compared creating our textures from SVGs 
using the OpenGL paint engine and the raster paint engine. Beside being 
buggy ( https://bugreports.qt.io/browse/QTBUG-52672 ) and having a worse 
quality with antialiasing the surprising result was: the OpenGL engine 
was slower.

Not sure if this is still the case. If yes it might be because of the 
tesselation being more expensive than the actual rendering - but I havn't 
looked deeper into this.

( My test was done running over our 1000 SVGs - code can be found here: 
https://github.com/uwerat/qskinny/blob/master/examples/gbenchmark/
Benchmark.cpp )

> There is talk of rearchitecting QStyle in Qt 6.  IMO this is a very
> important feature we should take into account.

Do you also already have specific plans about what to do with Qt/Quick 
core in Qt6 ?

Uwe




More information about the Development mailing list