xsen
xsen

Reputation: 141

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!

E.g.

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

Upvotes: 0

Views: 51

Answers (2)

Miguel Rodrguez
Miguel Rodrguez

Reputation: 141

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"
}

Upvotes: 1

Parsa Mousavi
Parsa Mousavi

Reputation: 1212

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.

Upvotes: 1

Related Questions