简体   繁体   English

QML分辨率独立的应用程序

[英]QML resolution independent application

Is it possible to use some resolution independent measurement unit in Qt/QML? 是否可以在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) 我想使文本,按钮,边距,装饰性矩形的大小...在桌面(视网膜和非视网膜),android(dpi,xspi ...)和iOS(视网膜和非视网膜)中相等

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
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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