I’m using QTableView with QSqlTableModel to display data in a table. I’m displaying integer values as other unicode values- for example, displaying 0 as a checkmark.
self.model = QSqlTableModel(self)
index = self.model.index(0,5)
qv = QVariant(u"\u2713")
self.model.setData(index, qv)
This effectively changes the display, but it also changes the actual data. Is there a way in QTableView or QSqlTableModel to change the display or not the data? Or should I use a workaround, like saving the original data in a file and writing it back when the program closes?
Thanks!
–Erin
Try setting the edit strategy so that changes are not submitted immediately: