The reason for using a QTableView
is that rather than adding data to the view directly, you can use the Model-View-Controller paradigm instead.
You need to create a subclass of QAbstractItemModel, and then set the model using QAbstractItemView.setModel()
, which QTableView
inherits from.