вы можете использовать заголовок.Ваш код будет выглядеть примерно так:
ApplicationWindow {
id: window
visible: true
width: 640
height: 480
ListView {
id:listview
anchors.fill: parent
model: 15
verticalLayoutDirection: ListView.BottomToTop
headerPositioning: ListView.OverlayHeader
header: Rectangle {
height: listview.height/5
width: listview.width
color: Qt.rgba(Math.random(),Math.random(),Math.random(),1)
z:2
Text {
text: "0"
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: "white"
font.pixelSize: 35
}
}
delegate: Rectangle {
height: listview.height/5
width: listview.width
color: Qt.rgba(Math.random(),Math.random(),Math.random(),1)
Text {
text: index+1
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: "white"
font.pixelSize: 35
}
}
}
}