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

QScrollArea is broken in high DPI environments (when calling winId() on QScrollArea's widget)



    • Bug
    • Resolution: Done
    • P2: Important
    • 5.14.2, 5.15.0 Beta2
    • 5.12.5, 5.13.2, 5.14.1
    • GUI: High-DPI
    • Any Windows system with multiple monitors attached, and at least one of the monitors at 200% or more scaling.
    • Windows
    • 529cfe4e22cc02dc7c29f653e8ff23656aa16ff9 (qt/qtbase/5.14) 08d5059320334223ff1f9009342324f25c231f0b (qt/qtbase/5.14)


      QScrollArea does not work correctly in a mixed DPI environment in Windows.   This appears to be tied to a window that is native ( uses winId() ).   When the window is moved from a monitor scaled at 100% to a monitor scaled at 200% or higher, the scroll area disappears, along with any contents within.   There are also some QScrollArea artifacts on the screen that disappear once the window is resized.   Once the window is moved back to the 100% scaled monitor, it is back to normal again (once you resize it- it initially still is incorrect).

      This is easily reproduced with the simple application I've attached.  The application creates scroll area and a main view, and sets the view of the scroll area to that view.   It then calls winId() to get a native window handle, and then calls BitBlt to paint the view white.   When launched, it works great on the 100% scaled monitor, but not on the 200% scaled monitor (appears black).

      This is a show-stopper for us moving our application to newer versions of Qt.  We do direct screen rendering using OpenGL and Direct3D and need to be able to render on a native window.

      Note:  This behavior does NOT happen if the Qt property AA_EnableHighDPIScaling is not specified.   However, we rely on that to make our application DPI aware.

      None of the 5.9.x versions of Qt exhibit this.  Versions 5.12 up to 5.12.4 are ok, but 5.12.5 and beyond are broken.  All major versions beyond 5.12 are also broken.

      Attached is the application, along with some screen shots of the behavior.


        1. 5-14-1 200 percent.PNG
          5-14-1 200 percent.PNG
          19 kB
        2. 5-14-1 artifacts.PNG
          5-14-1 artifacts.PNG
          19 kB
        3. 5-9-9 100 percent.PNG
          5-9-9 100 percent.PNG
          5 kB
        4. 5-9-9 200 percent.PNG
          5-9-9 200 percent.PNG
          5 kB
        5. Qt512HighDPIBug.zip
          4 kB
        6. qtbug82312_diag.diff
          9 kB
        7. qtbug82312.zip
          3 kB

        Issue Links

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



              owolff Oliver Wolff
              jeremyhp Jeremy Cook
              0 Vote for this issue
              4 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes