From a6f2bcd4e9d39e4f7b5c919fc46378884f7b4a98 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 15 Dec 2020 23:41:25 +0100 Subject: ScrollView: let flickable have pixelAligned set to true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A ScrollView will typically contain other controls. And if we're using a dpr with a fraction (e.g 1.25), the position of the controls will sometimes jitter as you scroll. The result is that if e.g a Frame is wrapped tight around around a Rectangle, the frame will sometimes be outside the rectangle, and other times on top. This is because of rounding issues when drawing the Frame vs the Rectangle. So let the default flickable used by a ScrollView have pixelAligned set to true. This will give the best cross-platform "out of the box" experience. The developer can always choose to use his own Flickable for ScrollView, and tweak it, if such default behavior is not wanted. Pick-to: 6.0 Change-Id: I7dc7b0b390dbf055f35cca2a6c15a6075e33c0a4 Reviewed-by: Jan Arve Sæther --- src/quicktemplates2/qquickscrollview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp index ae2b52d6..a94c4595 100644 --- a/src/quicktemplates2/qquickscrollview.cpp +++ b/src/quicktemplates2/qquickscrollview.cpp @@ -195,6 +195,7 @@ QQuickFlickable *QQuickScrollViewPrivate::ensureFlickable(bool content) // optimization is needed, the user can simply create his own flickable // child inside the scrollview, and control clipping on it explicit. flickable->setClip(true); + flickable->setPixelAligned(true); setFlickable(flickable, content); } return flickable; -- cgit v1.2.3