문제

I have a QTableView which displays data from a QSqlTableModel. I want my model to check for changes when a user hits a "refresh" button but I can't find a way to update the data. I tried the reset() and update() methods on the model without any result.

Is it possible to "re-read" from the database and update the model? How?

도움이 되었습니까?

해결책

As you dont state what you canged in your model, ill assume the simplest form of change (changed data).

For me model.select() works to update the data in the model and force the View to update itself.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top