> On 15 Feb 2021, at 13:48, Anisha kaul <anisha.kaul.1...@gmail.com> wrote:
> 
> Well, thank you for the response and for the idea about creation and deletion 
> of objects. I tried it and it worked.
> I am feeling though that it is not a good way of writing code.
> Am I trying to solve a wrong problem?
> 
> My aim is to run this application on screens of different PPI. So, I thought 
> that I can get the PPI and set the scale accordingly.
> Any other suggestions about some proper way to solve this?

Qt Quick already takes care of this for you. And if you need to get the scale 
factory manually, it’s available via QWindow::devicePixelRatio().

You should use this. That will work on OSes that tweak DPI, as well as OS’es 
that don’t. 

Do not use QT_SCALE_FACTOR for anything but testing.

Tor Arne 
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to