Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-27389

Qt doesn't scale the widgets according to DPI under X11 (unlike under Windows and OSX)

    XMLWordPrintable

Details

    • macOS

    Description

      Qt doesn't scale the widgets according to X11 DPI setting, but does so under Windows and OSX. You can see the code here:
      http://qt.gitorious.net/qt/qt/blobs/4.8/src/gui/styles/qstylehelper.cpp
      The function dpiScaled (in QStyleHelper namespace) returns correct results for the other windowing systems, but always returns 1.0 for X11, which is strange since the display resolution is readily available as qApp->desktop()->logicalDpiX().

      This issue really prevents using high-DPI displays (like the new "retina" 220 dpi display) from being used with Qt applications under Linux/X11, and this is a huge shame. Even with standard displays it's sometimes desirable to run them at e.g. 150dpi, to relieve the eye strain, and this problem makes it painful.

      I'm attaching 4 screenshots to demonstrate the problem - x11/192dpi, x11/96dpi, windows/192dpi, windows/96dpi. Pay particular attention to OK/Cancel buttons, MDI window titlebar, etc...

      Thanks!

      Attachments

        1. qt_x11_96dpi.png
          qt_x11_96dpi.png
          219 kB
        2. qt_x11_192dpi.png
          qt_x11_192dpi.png
          328 kB
        3. qt_win_96dpi.png
          qt_win_96dpi.png
          110 kB
        4. qt_win_192dpi.png
          qt_win_192dpi.png
          133 kB
        5. libqt4_respect_dpi_in_styles.diff
          0.6 kB

        Activity

          People

            rodal Samuel Rødal
            alex_sh Alexander
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: