I am trying to create a custom row delegate for a TableView
. according to the Documentation, the rowDelegate
should have access to a property called styleData.row
. However, when I'm try to access this property, it is undefined. I used the debugger to check whats inside the styleData
, and the row
is missing:
My code is very simple:
TableView {
width: 500//DEBUG
height: 300//DEBUG
model: ListModel {
ListElement {
lectureName: "Baum1"
}
ListElement {
lectureName: "Baum2"
}
ListElement {
lectureName: "Baum3"
}
ListElement {
lectureName: "Baum4"
}
}
rowDelegate: HeaderRowDelegate {//simply a Rectangle with an in property called "modelRow"
id: rowDelegate
modelRow: {
var data = styleData;
return data.row;
}
}
TableViewColumn {
id: c1
role: "lectureName"
title: "TEST"
}
}
modelRow: styleData.row
? – sk2212undefined
? – sk2212HeaderRowDelegate
? Please show some code. – sk2212