fixed deleting sellers

This commit is contained in:
Martin Brodbeck 2018-07-18 08:17:30 +02:00
parent e766b3ff95
commit d39c72b0a2
3 changed files with 14 additions and 1 deletions

View file

@ -34,8 +34,16 @@ void SellerDialog::on_deleteButton_clicked()
auto selModel = ui_.tableView->selectionModel();
if (selModel->hasSelection() == false)
return;
auto indexes = selModel->selectedRows();
auto dlgResult =
QMessageBox(QMessageBox::Icon::Warning, "Sind Sie sicher?",
"Löschen wirkt sich direkt auf die Datenbank aus. Möchten Sie fortfahren?",
QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this)
.exec();
if (dlgResult == QMessageBox::No)
return;
auto indexes = selModel->selectedRows();
std::sort(indexes.begin(), indexes.end());
// Deleting the rows, beginning with the last one!