setting QT_DEVICE_PIXEL_RATIO for a specific application
-
qputenv works also on OS X and Linux. IIRC yes OS X already handles that
-
Excellent, you are right, that also works on Linux.
Thanks a lot! -
Hi, I need to change the QT_DEVICE_PIXEL_RATIO to "auto" in windows 10.
I'm not a software developer and I have no idea how to do this I really appreciate if you can help me with this.
-
Hi and welcome to devnet,
If it's to test your application while using Qt Creator: go to the run part of the Project panel. There you can edit the environment variables. Add a new variable with the name QT_DEVICE_PIXEL_RATIO and in value write auto.
-
@SGaist said:
QT_DEVICE_PIXEL_RATIO
Hi,
I did set the variable to AUTO as you mentioned.
My app run fines on 1366768 screen resolution size. But if I keep my screen resolution to 1024768, UI gets cut. (cannot see buttons of my UI app).
What would be the probable way to fix my app to all resolution of screen? -
Are you using layouts to handle your widgets ?
-
If your application needs a minimal size then you can put your main widget in a QScrollArea. That way if your application doesn't fit, you'll have scroll bars to move up/down to access the rest of your UI.
-
Not really a last option. If the design of your UI is big enough to not fit some screen resolution you can either change the design to fit a larger set of screen resolution. or make it more modular under a certain size. A scrolling area is not a bad solution otherwise how would you browse internet ?