It's not clear to me how to access the model from the header component in ListView. I have provided headerData
in the (C++) model, but it doesn't seem to be called. I can grab the data from the model in theRowDelegate
, so my roles are defined correctly (I have implemented the roleNames
function).
I'm sure this must be explained in the documentation somewhere, but I can't find it.
ListView{
anchors.fill: parent
model: logfile_model
orientation: Qt.Vertical
header: Row{
Text{
text: increment // Doesn't work
width: 100
}
Text{
text: iteration // Doesn't work
width: 100
}
}
delegate: Row{
Text {
text: increment
width: 100
}
Text {
text: iteration
width: 100
}
}
}
data
function in the model? I could just pretend the header is a row, but I don't know how to set it so it is always visible. - mohamedmoussa