Best method to have GUI scale to display pixel density
-
wrote on 21 Nov 2013, 21:40 last edited by
Sorry if this is the wrong forum for this question as I still am learning all that Qt has to offer.
I am developing WIndows Desktop application and am curious as to the best way to have a GUI scale based on display pixel density.
My application looks fine on a 96dpi screen but is too small for the Windows Surface at 208dpi.
Short of developing 2 separate GUIs, does Qt have a way to linearly scale the entire GUI?
-
wrote on 22 Nov 2013, 06:15 last edited by
You could use Qt layout, it could be done in qt designer or coding directly.
-
wrote on 26 Nov 2013, 20:03 last edited by
I opened several examples that ship with Qt that use layouts and while some widgets resize with the the main window, the fonts, scrollbars and pushbuttons do not.
I am looking for a way to scale everything the mainwindow or dialog based on the outer most size.
It doesn't seem that Qt layout does this, or am I still missing something.
-
wrote on 27 Nov 2013, 01:24 last edited by
Actually your application should scale with the Windows DPI configuration. For example, if you change the DPI settings from 96 DPI (100%) to 144 DPI (150%), then your application will simply appear 50% larger. Qt does that all automatically for you ("DPI awareness"), except for fixed-size pixel images.
Application at 96 DPI:
http://i.imgur.com/woRHPzF.pngThe yery same application at 144 DPI:
http://i.imgur.com/9bTEeU2.png
4/4