How to refresh QSqlQueryModel?
Unsolved
General and Desktop
-
Hi.
I have a TableView in my project that uses a QSqlQueryModel.
The information is well displayed on the table, however, when the data in the database changes I want to "refresh" and "reload" the table... I can't understand how!
Suppose I want to update the tableview whenever I click a button:
void MainWindow::on_btnRefresh_clicked() { _myModel->query().exec(); }
This doesn't work.
The tableDataChanged signal is useless in this case, because i'm not changing the data directly from the table GUI, but I just want to refresh the table itself since the database is being updated by other sources and programs.
Thank you in advance!
-