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:
Qt Code:
  1. QSqlRecord r = _dtModel->record();
  2. r.setNull ("id");
  3. r.setValue ("name", "New Document Type");
  4. r.setValue ("micr", 0);
  5. r.setValue ("code", 0);
  6. _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.