Added delete support to the CRUD system.
This commit is contained in:
parent
36f5153091
commit
8c20bd6a02
8 changed files with 230 additions and 89 deletions
|
|
@ -22,6 +22,7 @@ CrudTab::CrudTab(MainWindow *parent)
|
|||
ui->tableView->setModel(m_crudModel);
|
||||
|
||||
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
ui->tableView->addAction(ui->actionRemove_rows);
|
||||
//auto selection_model = ui->tableView->selectionModel();
|
||||
// connect(ui->tableView->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
|
||||
// &CrudTab::tableView_currentRowChanged);
|
||||
|
|
@ -55,3 +56,15 @@ void CrudTab::refresh()
|
|||
{
|
||||
m_crudModel->loadData();
|
||||
}
|
||||
|
||||
void CrudTab::on_actionRemove_rows_triggered()
|
||||
{
|
||||
// determine selection
|
||||
|
||||
// ui->tableView->currentIndex()
|
||||
// selectionModel()->
|
||||
|
||||
//ui->tableView->selectionModel()->selectedRows()
|
||||
m_crudModel->removeRow(ui->tableView->currentIndex().row());
|
||||
//removeRows();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue