Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
d290cb3a499a0c3a71ab1f63cbd2fc45b0f5835f
Description
Run the following code and press keys "2" and "3" quickly to rapidly insert then remove the same index. If the removal is performed before the add displaced animation has animated all of the items in the view, the layout is not performed correctly, and somewhere in the view there will be a blank space in a spot where an item should be.
This doesn't happen if the PauseAnimation is removed.
import QtQuick 2.0 Item { width: 300; height: 400 ListView { id: view anchors.fill: parent anchors.margins: 30 model: ListModel { ListElement { name: "A" } ListElement { name: "B" } ListElement { name: "C" } ListElement { name: "D" } ListElement { name: "E" } ListElement { name: "F" } } delegate: Rectangle { width: 200; height: 30 border.width: 1 color: ListView.isCurrentItem ? "yellow" : "lightsteelblue" objectName: name Text { text: name + " " + parent.y; anchors.centerIn: parent } } focus: true Keys.onDigit2Pressed: model.insert(1, {"name": "New item"}) Keys.onDigit3Pressed: model.remove(1) add: Transition { NumberAnimation { properties: "x,y"; duration: 1000} } addDisplaced: Transition { id: addDisplaced SequentialAnimation { PauseAnimation { duration: addDisplaced.ViewTransition.index * 200 } NumberAnimation { properties: "x,y"; duration: 1000; easing.type: Easing.OutBounce } } } removeDisplaced: Transition { NumberAnimation { properties: "x,y"; duration: 1000} } } }