Skip to content

[2 dpr patches] Fix backingstore fractional DPR glitches for widgets in child windows / Graphicsview: Avoid background clearing glitches under fractional DPR

[PATCH 1/2] Fix backingstore fractional DPR glitches for widgets in child windows

For such widgets, QBackingStore::flush() takes both a region and an
offset. Both must to be DPR scaled to the native backingstore
coordinates. When the DPR is fractional, it can happen that the
rounding of both effectively accumulate into an off-by-one error.
Detect and adjust for this situation to avoid painting glitches.

Task-number: QTBUG-96223
Fixes: QTBUG-102366
Pick-to: 6.3 6.2 5.15
Change-Id: I9ccd4ee54660419a1db8c27358f1419de58ae932
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit f5174abec3720b7deec3157e482ca62c0d90fb19)

[PATCH 2/2] Graphicsview: Avoid background clearing glitches under fractional DPR

QGraphicsView enables autoFillBackground on the viewport widget, so
the dirty area is cleared before repaint. Then QGraphicsView fills the
same area with the background color. However, under fractional DPR
scaling, the scaled version of the dirty rect may end up covering only
a fractional part of the pixels on the edges. If antialising is
enabled, such pixels will be only partially filled with the background
color, leaving the clear color partially visible as glitches. This can
be seen in the dragdroprobot example.

Fix by disabling AA during background filling, as it has no purpose
then anyway.

Task-number: QTBUG-96223
Pick-to: 6.3 6.2 5.15
Change-Id: Ica00997141701faa0cf368caced84ae50ba017d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6963190581eb49b96c68b0e61304663672f1e42b)

Merge request reports