Remove row form QSqlTableModel problem?
we have QSqlTableModel linked to QSQLITE table.
when i perform removeRow() method the ! appear.
i d'like to disappear row immediately. my Algorithm like this:
- remove current row.
- disappear immediately.
- changes saved to database.
i have try various strategy to solve problem. and then post it here to find standard guidelines:
*model strategy: *
// command signal and slot:
@connect(ui->DeleteButton, SIGNAL(clicked()), this, SLOT(removePcType()));@
@void editPcTypeDialog::removePcType() // private slot
int row = ui->tableView->currentIndex().row();
pctypesTableModel->removeRows(row, 1, ui->tableView->currentIndex()); //pctypesTableModel->submit(); //pctypesTableModel->submitAll();
QSqlTableModel does no longer implicitly select() once a row has been removed; you will have to call select() explicitly.
bq. QSqlTableModel does no longer implicitly select() once a row has been removed; you will have to call select() explicitly.
thank u too i will work on this idea and *post results laters *An Chaa Allah.