You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scroll for ScrollView is applicable only for ScrollView, so I can't use it for ListView for example
scroll for Flickable is buggy and leads to infinite scrolling. Some changes landed because of this assumption chore: reworked scroll method #15513 in this PR, so we basically moved to use scroll for scrollView. But the initial problem with Flickable scroll is the method implementation. To fix this issue I probably need to check if the view is at the end, because flick never scroll infinitely, always till the end (or till the beginning) of scroll view object
issue with both implementations. Both functions are receiving a qml object and want to scroll until this object is visible. But the delegates in listviews are lazy and are created only when the object is close to being visible.
So it's only good to scroll to an object close to the view
// Some pseudocode
function object_in_view(flickable, object)
return object.exists &&
object.y > flickable.contentY - flickable.originY && // check if the object is below the current top of the view
object.y + object.height < flickable.contentY - flickable.originY + flickable.height // check if the object is above the current bottom of the view
function scroll_to_object(flickable, object)
flickable.contentY = flickable.originY //move at beginning
if object_in_view
return
while !flickable.atYEnd
flick
if object_in_view
return
Bug Report
Description
There are 2 scrolls now in framework:
scroll for ScrollView:
status-desktop/test/e2e/gui/elements/scroll.py
Line 15 in 9050459
scroll for Flickable:
status-desktop/test/e2e/gui/elements/scroll.py
Line 33 in 9050459
There are 2 problems here:
So it's only good to scroll to an object close to the view
Suggested implementation per @alexjba
Also, if we have an index and want to scroll to it in a ListView, we can easily use https://doc.qt.io/qt-5/qml-qtquick-listview.html#positionViewAtIndex-method. Same with GridView. That might be worth implementing as well
The text was updated successfully, but these errors were encountered: