I use QSqlQueryModel.setQuery() method to read data from two tables in a MYSQL database, and set the QSqlQueryModel object to a QTableView object.
For some reason I'll alter some data in the MYSQL tables by using QSqlQuery.exe() method, but the QSqlQueryModel and QTableView object can not be refreshed automaticly after the database changed. What is the best method to refresh/update the modle and view?
I have tried a QSqlQueryModel.setData() method to force the model data changed but it does not work, only by calling the QSqlQueryModel.setQuery() method again could work.But it is inefficiency parsing a new query just to refresh it. I just want to refresh a row or a value in the tableview.