Hello,
i have a fairly simple model (QSqlTableModel based) being displayed by a QTableView.
i provide buttons to insert rows at the end of the existing, basically just doing that:
r.setNull ("id");
r.setValue ("name", "New Document Type");
r.setValue ("micr", 0);
r.setValue ("code", 0);
_dtModel->insertRecord(-1, r);
QSqlRecord r = _dtModel->record();
r.setNull ("id");
r.setValue ("name", "New Document Type");
r.setValue ("micr", 0);
r.setValue ("code", 0);
_dtModel->insertRecord(-1, r);
To copy to clipboard, switch view to plain text mode
However, upon adding a type, i loose the previous table selection...
Why, and how to prevent that (And i dont really want to re-select previously selected items because it involves a lot of other table queries, i'd rather want to just *avoid* loosing the current selection)?
Thanks,
Pierre.
Bookmarks