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

Scaling changed on the primary monitor affects fonts on the secondary one

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.2, 5.12.2
    • GUI: Font handling
    • None
    • Windows

    Description

      Formerly we enabled Qt::AA_EnableHighDpiScaling in our software and started to observe some issues with texts that are shrinked unexpectedly under some primary/secondary scaling settings. Widgets displayed on a non-primary monitor are affected by changing scaling on the primary one. Here are tested use cases (individual screenshots are attached) with some observations:

      Use case Primary monitor scaling Secondary monitor scaling Notes
      1 125% (recommended) 100% (recommended) Dialog on the secondary monitor.
      2 150% 100% (recommended) Dialog on the secondary monitor. Expected same font size as in use case 1, but the texts shrank.
      3 175% 100% (recommended) Dialog on the secondary monitor. Texts still shrinked, but less than in use case 2.
      4 125% (recommended) 100% (recommended) Dialog on the primary monitor. Looks as expected.
      5 150% 100% (recommended) Dialog on the primary monitor. Looks as expected.
      6 175% 100% (recommended) Dialog on the primary monitor. Looks as expected.
      7 150% 125% Dialog on the secondary monitor. Texts shrank pretty much in the same way as in use case 2.
      8 150% 150% Dialog on the secondary monitor. The texts get quite big.

      The primary screen is a laptop screen (1920x1080 15.6") and the secondary one is an external monitor (1920x1200 24").

      I've looked at sources briefly and found for example hardcored screen 0 on multiple places in QFontMetrics (for example here in the current sources) constructor, which could be one source of such problems. This was on Windows but I expect some issues also on Linux due to the hardcoded primary screen.

      The screenshots were obtained with Qt 5.11.2, it was also observed with Qt 5.12.2. Also worth noting is that I can observe this problem with Qt Creator (using version 4.7.2).

      Attachments

        1. test1.zip
          4 kB
        2. use_case_1.png
          use_case_1.png
          15 kB
        3. use_case_2.png
          use_case_2.png
          13 kB
        4. use_case_3.png
          use_case_3.png
          15 kB
        5. use_case_4.png
          use_case_4.png
          23 kB
        6. use_case_5.png
          use_case_5.png
          30 kB
        7. use_case_6.png
          use_case_6.png
          37 kB
        8. use_case_7.png
          use_case_7.png
          12 kB
        9. use_case_8.png
          use_case_8.png
          30 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            madcz Martin Dien
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes