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

Windows HiDPI display: GraphicsView with QGLWidget paints only in the lower left quadrant if scaling>100%

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.6.2
    • Fix Version/s: 5.9
    • Labels:
      None
    • Environment:
      Windows 10 Pro, HiDPI display laptop (Dell XPS13 3200x1800)

      Ubuntu 16.04, HiDPI display laptop (Dell XPS15)
    • Commits:
      d7bb44dba4e894c14e500d29aaa889c6b7df01db

      Description

      On Windows 10 with a HiDPI display, when the scaling factor is greater than 100%, the graphics items in a graphics view, when the viewport is a QGLWidget, are painted in the lower left quadrant.

      On Windows 10, to change the scaling factor: right click on the desktop, select "Display settings", change the slide from 100% to 200% for "Change the size of text, apps, and other items:"

      This problem does not occur on Mac with a retina display. It happens on Linux too ( Dell XPS15 ) with QT_SCALE_FACTOR=2 QT_AUTO_SCREEN_SCALE_FACTOR=0. Note that you don't even need a 4k display on Linux to see this, just passing these environment variables is enough to show the issue.

      The attached minimal example (main.cxx) set Qt::AA_EnableHighDpiScaling to true, opens a QMainWindow where the central widget is a QGraphicsView. The QGraphicScene attached to the QGraphicsView consists of a single QPushButton with a long text.

      The viewport of the QGraphicsView can be chosen to be: the default (nothing set explicitly), a QGLWidget or a
      QOpenGLWidget. The choice is done by commenting out macros at the beginning of the file.

      When the scaling is 100%, all viewport options render the QPushButton correctly. However, when the scaling is 200%, when the viewport is a QGLWidget only the lower left quadrant is rendered. The problematic screenshot is qglwidget_200percent.png.

      I attached screenshots for each viewport mode (default, QGLWidget, QOpenGLWidget) and each scaling factor (100%, 200%).

      Using QOpenGLWidget in my application is not an opinion as it relies on GLEW (as far I know and I experimented, QOpenGLWidget and GLEW are not compatible).

        Attachments

        1. default_100percent.png
          default_100percent.png
          3 kB
        2. default_200percent.png
          default_200percent.png
          8 kB
        3. main.cxx
          2 kB
        4. qglwidget_100percent.png
          qglwidget_100percent.png
          3 kB
        5. qglwidget_200percent.png
          qglwidget_200percent.png
          5 kB
        6. qopenglwidget_100percent.png
          qopenglwidget_100percent.png
          2 kB
        7. qopenglwidget_200percent.png
          qopenglwidget_200percent.png
          7 kB
        8. qtdiag_output.txt
          7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            fbertelschrodinger François Bertel
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes