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

Qt 5/Windows: QFontDialog does not resolve pixel font size correctly

    XMLWordPrintable

Details

    • Windows

    Description

      The Qt Font Dialog sporadically does not resolve the font size correctly when it is in pixels.
      The problem can be reproduced when you have multiple displays connected all with different scaling defined in OS.
      If there are 2 displays: primary screen has scaling 100%, the other 125%.
      and if QFontDialog is open on the display with 125% scaling the Font size is not resolved correctly.
      Despite the font has a correct size in pixels (see debug output).
      Attached simple example and video which demonstrate it.

      Update:
      Steps to reproduce: Use modified example.

      The problem can be reproduced when you have multiple displays connected all with different scaling defined in OS.
      The issue occurs for some fonts and sizes (not for all) when using Qt Font Selector.

      I can always reproduce this bug with the following configuration:

      • Primary monitor - 100% scaling
      • Secondary monitor - 125% scaling

      Please follow these steps:
      1. You need to have a Font Selector on the secondary monitor (the one with 125% scaling).

      2. Select Arial font and a font size 10 and click OK in the Font Selector.

      3. Open Font Selector again (it should be opened on the same monitor where it was closed - secondary monitor). The previously selected font with the size is correctly preselected - Arial 10.

      4. Change font size to 9 and click OK in the Font Selector.

      5. Open Font Selector again (it should be opened on the same monitor where it was closed - secondary monitor). The previously selected font with the size is preselected - Arial 9 (it is good).

      6. Change font size to 8 and click OK in the Font Selector.

      7. Open Font Selector again (it should be opened on the same monitor where it was closed - secondary monitor). There is a wrong font size preselected in the Font Selector! You can see Arial 10, instead of Arial 8. However, the debug output shows the correct font size in pixels. That is a bug in the Font Selector not correctly resolving the font size in pixels.

      Attachments

        1. bugDemo (1).mkv
          647 kB
        2. qtbug106600_modified2.zip
          2 kB
        3. qtbug106600.zip
          4 kB
        4. qtbug106600-modified.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tokorpip Tomi Korpipää
            irfan.omair@digia.com Irfan Omair
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes