Add delete logic for patient table view
This commit is contained in:
@@ -132,6 +132,23 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
//TODO:add some error handle logic
|
||||
}
|
||||
});
|
||||
|
||||
connect(btnDelete, &QToolButton::clicked,[=](){
|
||||
if (currentRow<0)return;
|
||||
model->removeRow(currentRow);
|
||||
if (model->submitAll())
|
||||
{
|
||||
model->select();
|
||||
if (model->rowCount()>0)
|
||||
{
|
||||
table->selectRow(0);
|
||||
} else{
|
||||
currentRow=-1;
|
||||
}
|
||||
} else{
|
||||
//TODO:error handle
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
SelectFormWidget::~SelectFormWidget()
|
||||
|
||||
Reference in New Issue
Block a user