Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
1686a82f3859ce2a0f48774ded21bf9817f5abc9
Description
With the following example, flick to the bottom of the GridView and press Return to remove the first item. Now scroll to the top and observe there is a hole where the first item should be; the GridView has not updated its layout. This does not happen if the item is removed while it's in view.
import QtQuick 2.0 Item { width: 300; height: 300 GridView { id: view2 width: 240; height: 320 cellWidth: 80; cellHeight: 60 model: ListModel { id: model2 Component.onCompleted: { for (var i=0; i<20; i++) append({'name': 'item ' + i, 'size': 20 }) } } delegate: Rectangle { width: 80; height: 60; border.width: 1 Text { text: name } } } focus: true Keys.onReturnPressed: { model2.remove(0) } Rectangle { anchors.bottom: parent.bottom width: 20; height: 20; color: "blue" NumberAnimation on x { loops: Animation.Infinite; from: 0; to: 300; duration: 100000 } } }
Attachments
For Gerrit Dashboard: QTBUG-21588 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
8321,4 | GridView should re-layout if add/remove before visible index | master | qt/qtdeclarative | Status: MERGED | +2 | 0 |