How to access the current item in a TableViewColumn
?
TableView {
id: atcTableView
model: myatclist
...
TableViewColumn {
...
}
TableViewColumn {
id: atcTableViewColFreq
role: "frequency"
title: "Frequency"
width: 120
delegate: Component {
Text {
text: "Freq is " + currentItem / model / model.frequency
}
}
}
As of this similar question " How do you access the roles of the currentItem from a listview in QML? " I have tried all kind of combinations model
, modelData
, currentItem
, and something like model.role
.
If I remove the delegate entirely, frequency displays correctly. Model is based on QAbstractListModel
. Any hints?
Btw, can I see in QML debugging what properties are available in a delegate?
-- Edit based on Kakadu's comment --
delegate {
Text {
text: "freq is " + frequency
}
}
gives me: ReferenceError: frequency is not defined
delegate: Text { text: view.model.get(styleData.row).frequency }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With