trying to use multiple columns with qml Tableview & QAbstractTableModel
-
Hey guys, I've been trying to figure out how to get my QAbstractTableModel to correctly propegate role data & model data to my tableView in qml. My headers populate properly but nothing else is, any help would be massively appreciated!
I'm not entirely sure the format for these forums however I hastebined all of my code for readability.
http://hastebin.com/igoribowux.coffee - main.cpp
http://hastebin.com/yukuqoweva.vala - tableModel.h
http://hastebin.com/deyijivago.coffee - tableModel.cpp
http://hastebin.com/genuhisodu.sm - schedulerViewingPane.qml
essentially my goal is to have dynamically created vertical columns with mirrored rows, and then pass it through a QSortFilterProxyModel to filter out by column, I think I'm close!
-
Hi @zeryx
I've tried your code with the change below and it works fine (columns are getting populated at runtime)use var headerData = baseTableModel.headerList
instead of var headerData = headers at line number 11 in schedulerViewingPane.qml (http://hastebin.com/genuhisodu.sm).Since you are already passing EmployeeModelTable instance baseTableModel to the qml then why not use the headerList property from the instance instead of setting it again.