QSqlTableModel don't set Dirty Flag..
-
Dear all,
I delete row remove from QSqlTableModel but it doesn't show dirty flag & submitAll() doesn't work..
What's wrong with my code?@QSqlTableModel.removeRow(1);
QSqlTableModel.isDirty(); //return false
QSqlTableModel.submitAll(); //No changes to database@Thanks
-
Doesn't "isDirty":http://doc.qt.nokia.com/4.8-snapshot/qsqltablemodel.html#isDirty take a QModelIndex?
What does submitAll return?
Is your code really like QSqlTableModel.submitAll();?
Because that doesn't seem to be valid C++ code. -
Oh, sorry
Actually..
@QSqlTableModel.isDirty(QModelIndex())@Can it detect the whole table?
Thanks
-
Not that way
[quote]
If index is invalid or points to a non-existing row, false is returned.
[/quote]
You could listen to the dataChanged() signal however.