Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.2
-
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.