Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
Description
With the following code, scroll down until the content y is 60, then press the space key to execute a move(1, 6, 1).
As a result:
- The first item is Item 4, when actually Item 3 should be first
- Item 4 has an empty space beneath it
- Item 1 has not moved to below Item 6 as it should
The issue doesn't arise if we set the contentY programmatically instead of flicking (which does a refill).
See attached actual.png and expected.png (expected.png shows the result of just setting contentY -> 60 and then doing the move).
import QtQuick 2.0 Item { width: 500; height: 500 ListView { id: view2 width: 240; height: 320 x: 100 y: 100 model: ListModel { id: model2 Component.onCompleted: { for (var i=0; i<30; i++) { append({'name': 'item ' + i}) } } } delegate: Rectangle { width: 200; height: 20; border.width: 1 Row { Text { text: name + " : " + index + " : " } Text { text: " " + parent.parent.x + ", " + parent.parent.y } } objectName: name } focus: true Keys.onSpacePressed: { model.move(1, 6, 1) } } Rectangle { anchors.fill: view2 color: "lightsteelblue" opacity: 0.3 } Text { anchors.right: parent.right; text: "content y:" + view2.contentY + ", count: " + model2.count } }