Important: Please read the Qt Code of Conduct -

Best method to have GUI scale to display pixel density

  • 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?

  • You could use Qt layout, it could be done in qt designer or coding directly.


  • 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.

  • 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:

    The yery same application at 144 DPI:

Log in to reply