Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.0.0, 5.4.0 Beta
-
None
Description
The fix for QTBUG-17853 ensures the header/footer is displayed if the view reaches the first/last items via key navigation. However, the fix doesn't work for cases where ListView.ApplyRange is used, as in the following example:
import QtQuick 2.0 Rectangle { id: root property int current: 0 width: 600; height: 300 ListView { width: 200; height: parent.height model: ListModel { Component.onCompleted: { for (var i=0; i<9; i++) { append({'name': 'item ' + i, 'type': 'small', 'age': i }) } } } delegate: petDelegate header: Rectangle { height: 45; width: 200; color: "red" Text { text: parent.x + ", " + parent.y } } footer: Rectangle { height: 45; width: 200; color: "orange" Text { text: parent.x + ", " + parent.y } } highlight: Rectangle { color: "yellow" } preferredHighlightBegin: 80; preferredHighlightEnd: 220 highlightRangeMode: ListView.ApplyRange focus: true } // The delegate for each list Component { id: petDelegate Column { width: 200 Text { text: 'Name: ' + name + " " + parent.y } Text { text: 'Type: ' + type } Text { text: 'Age: ' + age } } } }
Attachments
Issue Links
- relates to
-
QTBUG-17853 QML ListView - List Header does not appear when the user scroll to the first item on the list
- Closed