简体   繁体   中英

QML resolution independent application

Is it possible to use some resolution independent measurement unit in Qt/QML?

I would like to make the size of the text, buttons, margins, decorative rectangles... the equal in desktop (retina and non-retina), android (dpi, xspi...) and iOS (retina and non-retina)

Since you can access all your parent components in an element you can base all your widths/heights off the parent heights. eg

Rectangle
{
  width: parent.width / 2
  anchors.centerIn: parent
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM