[Development] Scalable UIs in QtQuick (take 2)

ekke ekke at ekkes-corner.org
Thu Feb 18 16:08:34 CET 2016


I'm just evaluating mobile development with Qt 5.6Beta,
qt.labs.controls, Android, Material
and have set Qt::AA_EnableHighDpiScaling

now it would be cool to "think" in cm or mm

for my device (BlackBerry PRIV, Android 5.1.1)
with 544 ppi, where devicePixelRatio (scaling factor) is 3.5

would be more intuitive to define
Rectangle {
    width: 1 cm
    height: 0.6 cm
}
compared with
Rectangle {
    width: 64
    height: 40
}
and then to calculate:
64 * 3.5 = 224 / 544 ppi = 0.41 in = 1.04 cm

BTW: HighDpiScaling works great.
added images (to compare sizes with Rectangles):
test.png (64x40)
test at 2x.png (128x80)
test at 3x.png (192x120)
test at 4x.png (256x160)

devicePixelRatio of 3.5 was exactly in the middle between @3x and @4x
Qt uses the next larger one: test at 4x.png and scaled it down to 3.5
tested this also with a much larger image - all is well done.
great work !

-- 

ekke (ekkehard gentz)

independent software architect
international development native mobile business apps
BlackBerry 10 | Qt Mobile (Android, iOS)
workshops - trainings - bootcamps

*BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner*

max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke at ekkes-corner.org
blog: http://ekkes-corner.org
apps and more: http://appbus.org

twitter: @ekkescorner
skype: ekkes-corner
LinkedIn: http://linkedin.com/in/ekkehard/
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160218/4d5b14a4/attachment.html>


More information about the Development mailing list