PDA

View Full Version : Index (position) changed on saving with QTableView



Auryn
21st July 2008, 17:16
I have a QSqlRelationalTableModel with one QTableView of it.

After you change data on a row... visually the table goes to the top, difficulting the entry of sequencial data with tabulations or clicking on another position.

jpn
21st July 2008, 17:44
How do you change that data? Do you call select() somewhere?

Auryn
22nd July 2008, 09:15
When using

my_model.setEditStrategy(QSqlTableModel::OnManualS ubmit);
I save with

my_model.submitAll();

When using

my_model.setEditStrategy(QSqlTableModel::OnRowChan ge);
I don't save manually.

After saving, occurs a "reselect" and the table position goes to the beginning.

The position must go to next field when ending an edition with tab key. And when clicking on another position while we are in edit mode must go to that position, not to the beginning.

Thank you