The major difference between the two is that QTableView requires you to use an external class derived from QAbstractItemModel with it. The rowCount(), columnCount(), and data() methods for the item model are used by the table view to tell it how to fill in and format the table cells.
In QTableWidget, the model is built-in and you simply set the count and contents of table rows and columns individually in your program by creating QTableWidgetItem instances, filling them with information, and inserting them into the table widget.
If you are displaying information from a database, then QTableView is the way to go. If you are displaying data generated internally by your program, then either one will work, whichever is easier to map onto your program's data representation.
Bookmarks