replace model correctly

allow_new_sellers
Martin Brodbeck 4 years ago
parent 17c65a50ea
commit 2003530587
  1. 4
      src/gui/mainwindow.cpp

@ -49,7 +49,8 @@ void MainWindow::on_actionEditSeller_triggered()
auto dialog = std::make_unique<SellerDialog>(this);
int retCode = dialog->exec();
delete ui_.salesView->model();
auto oldModel = ui_.salesView->model();
ui_.salesView->setModel(nullptr);
if (retCode == QDialog::Accepted) {
marketplace_->sortSellers();
@ -63,6 +64,7 @@ void MainWindow::on_actionEditSeller_triggered()
}
ui_.salesView->setModel(new SaleModel(getMarketplace(), ui_.salesView));
delete oldModel;
ui_.salesView->setColumnHidden(2, true);
ui_.salesView->resizeColumnToContents(0);
connect(static_cast<BasketModel*>(ui_.basketView->model()), &BasketModel::basketDataChanged,

Loading…
Cancel
Save