I need to implement a table with Qt.
I believe that I will file a lawsuit in QAbstractTableModel using QTableView using this model.
I understand that I will need to edit the rowCount (), columnCount () and data () functions of the model.
However, I do not understand how to precisely set the data inside the model so that the data () function can restore it ..
Is setData () provided for this purpose? I saw that as a parameter that I do not need, EditRole is required, since I do not want my table to be editable.
So, how can I “set” data inside the model or get data for the model using the data () function?
Also, what is the data () function called, that is, who calls it, and where will it need to be called?
Please help me with this.
Thanks.
qt qtableview qabstracttablemodel
user1173240
source share