views:

26

answers:

1

hello
i have a QtableView that has a QsqlTableModel. i want my model to check for the changes when a user hit (refresh button) but i can't find a way to update data. i tried model.reset() and model.update() but they didn't work for me . i've been trying to find a solution for a couple of days

is it possible in anyway to re-read from database and update model ? and how ?

please help

thanks in advance

+1  A: 

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.

Horst Helge
yep it worked , thanks
Moayyad Yaghi