PDA

View Full Version : QTableView refresh problem



tebessum
26th December 2006, 10:51
Hi;

How can refresh TableView after remove a row.


model->removeRow(row);

delete row from model but data stay on the TableView
if use select() again before submitAll() to disappear new inserted record
how can refresh it.

Please help... :confused:

wysota
26th December 2006, 15:28
What kind of model did you use? QSqlQueryModel is read-only - you can't remove rows from it. If you implemented removeRows() yourself, you have to use beginRemoveRows() and endRemoveRows() to make sure views get refreshed.

tebessum
29th December 2006, 09:50
I understand the problem...


http://lists.trolltech.com/qt-interest/2005-09/thread00510-0.html

but now, i have another problem;

how can learn record state (inserted, updated or deleted) from QSqlTableModel


thank you...

wysota
29th December 2006, 12:22
What do you mean by "record state"? If you submit all changes to the model, operations will be comitted and your model will get updated.