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

Font sizes getting mixed up in multi display setups /w different scale factors on Windows

    XMLWordPrintable

Details

    • Windows

    Description

      The font sizes occasionally end up way too large or way too small considering the scale factor on Windows. This seems to occur especially after changes to scale factor and/or if different displays have different scale factors.

      For example if the main display scale factor is increased above recommended the font sizes seem to decrease on all monitors. This affects even Qt applications started after the change.

      Alternatively closing internal display of a laptop might throw the font sizes off in Qt applications on an external display.

      This kind of behavior can be reproduced with Qt Creator as well as Qt examples such as "examples/mainwindows/application". 

       

      Way to reproduce:
      1) Set the scaling of the display to 125 or 150% and make sure that this display is the main display

      2) Build and run the attached example with Qt 5.15.6

      3) The Text size of the buttons should be the same but they aren't. 
      4) If multiple displays are used and the scaling of the additional display is set to 100%, moving the button 2 to the additional window makes the text unreadable.

       

      Notes:
      This issue is not evident in the Qt 6.2.0.

      This issue  is not evident with QMessageBox.

      Explicitly setting the point size seems to fix the issue. 

      Also running app with: -platform windows:dpiawareness=1 at least alleviates the issue.

      Attachments

        1. qtbug95298.zip
          0.9 kB
        2. qtbug95298.diff
          2 kB
        3. machine2_qtdiag.txt
          10 kB
        4. machine2_qtcreator2.PNG
          machine2_qtcreator2.PNG
          361 kB
        5. machine2_qtcreator.png
          machine2_qtcreator.png
          294 kB
        6. machine1_qtdiag.txt
          12 kB
        7. machine1_application.png
          machine1_application.png
          38 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
              miikapernu Miika Pernu
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes