[Development] Scalable UIs in QtQuick (take 2)

Marco Martin notmart at gmail.com
Tue Mar 1 13:54:44 CET 2016

On Wednesday 24 February 2016 14:24:58 Gerry Boland wrote:
> Hey Simon,
> I can try offering the Ubuntu Touch perspective on units with QML (sorry
> if late, was busy for MWC).
> We created a units system for our QML apps, called grid unit:  units.gu(x).

Just to keep the picture complete to see the various approaches taken around 
here, in Plasma, we taken a similar approach, with an "units" singleton that 
defines a gridUnit value that is determined from the font size (M size 
actually, again to make it similar to CSS).
It works surprisingly well (basically the text is the center in the Plasma GUI 
and all the rest is sized/laid out around it)

As Gerry mentioned, we also had some problems to make it work nicely with 
DevicePixelRatio even tough that's kinda solved nowdays, but the main problem 
is that being a singleton it poses problems for multimonitor when different 
screens have a different desity.

And yeah, I would be very happy to see this kind of stuff directly managed by 
lower level QtQuick.

Marco Martin

More information about the Development mailing list