Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
At qt/qtdeclarative:master 1b65161042108ee46ca42331dacc2b66b63c6b4e
-
881091b5c0f1d2ead2b70e54f7ac2e4c17680b4e
Description
If the height of the first delegate in a ListView is 0, and all other delegates have a height of 20, the view's content y will constantly jump between zero and -20.
For example, using the following code, press Return to trigger the flickering:
import QtQuick 2.0 ListView { property int delegateHeight: 20 width: 240; height: 320 model: ListModel { Component.onCompleted: { for (var i = 0; i < 10; i++) append({}) } } delegate: Rectangle { width: 240; height: index == 0 ? delegateHeight : 20; color: "red" Text { text: index } } focus: true Keys.onReturnPressed: delegateHeight = 0 Text { anchors.bottom: parent.bottom; text: parent.contentY } }
The bug does not occur if there are more items than that which can fit into a single screen.
Attachments
Issue Links
- relates to
-
QTBUG-22014 ListView refill not working correctly if any delegate height is 0
- Closed