Jul-05-2022, 11:33 PM
(This post was last modified: Jul-05-2022, 11:33 PM by deanhystad.)
You know how to load data into an existing table view. You are doing it already.
# Create a new table view self.CategoryTableView = QTableView() self.CategoryTableView.setStyleSheet("background-color: rgb(255, 255, 255);") self.CategoryTableView.clicked.connect(self.findrow) self.CategoryTableView.selectionModel().selectionChanged.connect(self.getCellText) # Load the data self.CategoryTableView.setModel(self.model)The purpose of the model is to update the view to reflect the data. If the model is working correctlyl, the view should automatically update when the data changes. When you modify the model data it should emit a dataChanged signal. When this happens the view will redraw itself to show the new data.