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

QML content rendering inconsistently with fractional DPI scaling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.2
    • GUI: High-DPI
    • None

    Description

      With fractional DPI scaling active (such as 125%/150% scaling on Windows), QML content may render differently depending on the size of the window. See the example below:

      import QtQuick.Window
      Window {
              visible: true
              width: 500
              height: 500
              Repeater {
                      model: parent.width/2
                      Rectangle {
                              x: index*2
                              width: 1
                              color: "red"
                              height: 100
                      }
              }
      }

      This will display a "grating" of thin red vertical lines. Depending on the scaling factor, some rectangles may be wider than others because antialiasing is not enabled. For the experiment, I set OS-level scaling to 150% and resize the window horizontally with the mouse.

      Expected behavior: the content is static

      Observed behavior: the rectangles alternate between 2px and 1px width.

      Suggested fix:

      In QQuickWindow::renderSceneGraph replace pixelSize / devicePixelRatio with QSizef(pixelSize) / devicePixelRatio when calling setProjectionMatrixToRect.

       

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            anszom Andrzej Szombierski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes