QSqlTableModel how to detect that there are pending changes

630 views Asked by At

I am using QSqlTableModel/QTableView. editStrategy is OnManualSubmit. I have two buttons Save/Revert. Save's pressed is connected with model's submitAll and Revert's pressed is connected with revertAll. This works perfectly but I want to disable Save And Revert buttons when table doesn't contain any difference with database. So if user changed value of some cell from 5 to 6 my buttons become enabled and if then he changed from 6 to 5 my buttons must again become disabled. Is there a better way for doing this except manually caching model data and comparing with models content on each change?

0

There are 0 answers