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

Porting to Qt6: high dpi scale factor default rounding policy not documented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.1, 6.2.0 Alpha
    • 6.0.1
    • GUI: Painting
    • None
    • Windows 10 Desktop (screen with 175% scale factor)
    • Windows
    • fed19f0bd4ff0b6f7c212a4a8c8d9430e71f2e93 (qt/qtdoc/dev) affc1d5ff08f4032ed39a6f98c1fd531bf44b1d2 (qt/qtdoc/6.1)

    Description

      When porting my desktop apps to 6.0.1 on Windows 10, I have noticed that widgets based on QWidget have almost systematically painting glitches (missing lines, ghost lines when moving items in QGraphicsview, low resolution icons, etc...). 

      The problem can be reproduced with several Qt examples involving QWidget instances. I've attached the Icons Example to illustrate.

      After investigation, it looks like the problem is coming from Qt::HighDpiScaleFactorRoundingPolicy, which is defaulted to 'Round' in Qt 5.15 and to 'PassThrough' in Qt 6.0.1 (note: My scale factor is set to 175% in Windows).

      Maybe this change should be documented somewhere in Qt doc, maybe in 'Porting to Qt6' section. Anyway, please note that if you leave the default scale factor policy to 'PassThrough' for Qt6, many Qt examples won't display properly on Windows screens with scale factors above 100%.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-91239
          # Subject Branch Project Status CR V

          Activity

            People

              sorvig Morten Sørvig
              floc Flo C
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes