This question is basically asking the same thing - Is it possible to use QAbstractTableModel with TableView from QtQuick.Controls?
I have a QAbstractTableModel with data in the rows and columns. I want to be able to specify which column in my model the view should be displaying. This is not at all obvious to do, any help would be appreciated.
Basic examples rely on unique role names to ensure the correct data arrives in a given column, eg:
TableView {
TableViewColumn { role: "title"; title: "Title"; width: 100 }
TableViewColumn { role: "author"; title: "Author"; width: 200 }
model: libraryModel
}
The only hack I can think of is to assign each column in my model a unique role name, but this seems like a code smell, is there another simple way to specify the column index of my TableViewColumn
?