简体   繁体   中英

The element size in the Felgo simulator is quite different from the display size on the real machine

I found that the size of the element displayed on the Felgo Live Client is very different from the size displayed on the real device, which is much larger on the Felgo Live Client.The key is that the display ratios on both sides are not the same.

Has anyone encountered this problem, thanks!

Eg

AppButton {
    minimumWidth: 100
    minimumHeight: 100
    text:"HELLO"
}

It's quite normal for simple applications to behave differently on devices with different DPIs,aspect ratios and screen resolutions or even on the same device with a different orientation.
So you have to keep them in mind if you want to deploy your app into different devices.You can read more about that in the Qt Scalability guide and this one from Felgo.

Since the minimumWidth and minimumHeight are in pixels, you need to use the dp method, see https://felgo.com/doc/felgo-supporting-multiple-screens-and-screen-densities/#density-independence-support-dp-sp-pixeltoinches-tablet-orientation

AppButton {
    minimumWidth: dp(100)
    minimumHeight: dp(100)
    text:"HELLO"
}

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