Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Best method to have GUI scale to display pixel density
QtWS25 Last Chance

Best method to have GUI scale to display pixel density

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pklemm
    wrote on 21 Nov 2013, 21:40 last edited by
    #1

    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?

    Pete Klemm, consultant with Embedded Systems Research, Inc.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      devSJ
      wrote on 22 Nov 2013, 06:15 last edited by
      #2

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

      link:
      http://qt-project.org/doc/qt-4.8/layout.html

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pklemm
        wrote on 26 Nov 2013, 20:03 last edited by
        #3

        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.

        Pete Klemm, consultant with Embedded Systems Research, Inc.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MuldeR
          wrote on 27 Nov 2013, 01:24 last edited by
          #4

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

          The yery same application at 144 DPI:
          http://i.imgur.com/9bTEeU2.png

          My OpenSource software at: http://muldersoft.com/

          Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

          Go visit the coop: http://youtu.be/Jay...

          1 Reply Last reply
          0

          4/4

          27 Nov 2013, 01:24

          • Login

          • Login or register to search.
          4 out of 4
          • First post
            4/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved