I believe that in order to be able to call setModel you will need to use a QTableView rather than a QTableWidget.