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

Qt 5 and 6 disagree on the interpretation of HighDPI scaling environment variables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.6.0
    • GUI: High-DPI
    • None
    • Linux/X11

    Description

      Environment:

      • Linux/X11
      • Font DPI forced to 240 via X command-line (-dpi 240 and the X resources database (Xft.dpi: 240)
      • two displays, both HighDPI (see qtdiag.txt)
      • starting with a clear environment

      With this environment, it looks like Qt 5 concluded that a scaling factor of 3 was required, because the fonts and icons look much bigger:

      (background is KWrite using Qt 5.15 with KDE Qt Patch Collection, foreground is Qt Linguist, from Qt 6 dev branch at df2e07549e6edd1d271cce1d86cadd4a33dfd8fc).

      So I usually force QT_SCREEN_SCALE_FACTORS to the value "2;2".

      In this scenario, they look to have the same font and icons sizes, but the fonts are too small. Worse, Qt Creator (not shown, see QTCREATORBUG-29803) is even smaller, making it unusable.

      If I set QT_AUTO_SCREEN_SCALE_FACTOR to 0:

      It looks like the Qt 5 application changed but the Qt 6 one did not. Considering the majority of my desktop is still Qt 5, that's the set up I have optimised for. It used to work for Qt Creator (for some reason) but is now broken.

      QT_FONT_DPI has no effect and appears to never override anything.

      Attachments

        1. image-2023-10-24-10-12-03-524.png
          image-2023-10-24-10-12-03-524.png
          25 kB
        2. image-2023-10-24-10-16-17-140.png
          image-2023-10-24-10-16-17-140.png
          25 kB
        3. image-2023-10-24-10-50-08-207.png
          image-2023-10-24-10-50-08-207.png
          14 kB
        4. image-2023-10-24-10-50-47-585.png
          image-2023-10-24-10-50-47-585.png
          14 kB
        5. qtdiag.txt
          14 kB
        6. screenshot-1.png
          screenshot-1.png
          24 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sorvig Morten Sørvig
              thiago Thiago Macieira
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes