Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
None
Description
In this particular case the issue arises when moving multiple items backwards in a list. For example, if a model contains ['a', 'b', 'c'] then calling move(1, 0, 2) should move the last two items to the start of the list, resulting in ['b', 'c', 'a']. Instead, it results in ['b','a'] and 'c' is missing.
The problem is in the views / VisualDataModel; inspection of the list model reveals that 'c' is still in the model, but is just not visible in the view.
ListView { width: 300; height: 200 model: ListModel { ListElement { value: 'a' } ListElement { value: 'b' } ListElement { value: 'c' } } delegate: Rectangle { width: 40; height: 40 border.width: 1 Row { Text { text: index } Text { text: value; font.pixelSize: 20 } } } Component.onCompleted: { model.move(1, 0, 2) } }