I want to know to who the index
role belongs to. ListModel
, ListView
or others? How to test it?
ListModel{
id:testModel
ListElement{
// ....
}
// ....
}
ListView{
model:testModel
delegate:
Column {
Label{
text:index
}
}
}
The
index
property is exposed to the delegate by means of theListView
. That property is anint
, so it's probably passed by copy and you won't interfere with the attachee's logic by modifying it. For thedelegate
is a component handled by theListView
, you can safely suppose that theindex
property belongs to the latter and reflects a feature due to the provided model.What does it mean "how to test it"?