code cleanup
This commit is contained in:
parent
fb8bcc71e2
commit
fcf5f04539
2 changed files with 10 additions and 10 deletions
|
@ -30,10 +30,10 @@ MainWindow::MainWindow()
|
||||||
|
|
||||||
connect(ui_.actionQuit, &QAction::triggered, qApp, QApplication::quit);
|
connect(ui_.actionQuit, &QAction::triggered, qApp, QApplication::quit);
|
||||||
connect(ui_.actionEditSeller, &QAction::triggered, this,
|
connect(ui_.actionEditSeller, &QAction::triggered, this,
|
||||||
&MainWindow::on_actionEditSeller_triggered);
|
&MainWindow::onActionEditSellerTriggered);
|
||||||
connect(ui_.sellerNoEdit, &QLineEdit::returnPressed, this,
|
connect(ui_.sellerNoEdit, &QLineEdit::returnPressed, this,
|
||||||
&MainWindow::on_sellerNoEdit_checkSellerNo);
|
&MainWindow::onSellerNoEditCheckSellerNo);
|
||||||
connect(ui_.paidButton, &QPushButton::clicked, this, &MainWindow::on_paidButton_triggered);
|
connect(ui_.paidButton, &QPushButton::clicked, this, &MainWindow::onPaidButtonTriggered);
|
||||||
connect(ui_.basketView->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
connect(ui_.basketView->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
||||||
&MainWindow::onBasketViewSelectionChanged);
|
&MainWindow::onBasketViewSelectionChanged);
|
||||||
connect(ui_.cancelArticleButton, &QPushButton::clicked, this,
|
connect(ui_.cancelArticleButton, &QPushButton::clicked, this,
|
||||||
|
@ -44,7 +44,7 @@ MainWindow::MainWindow()
|
||||||
static_cast<SaleModel*>(ui_.salesView->model()), &SaleModel::onBasketDataChanged);
|
static_cast<SaleModel*>(ui_.salesView->model()), &SaleModel::onBasketDataChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionEditSeller_triggered()
|
void MainWindow::onActionEditSellerTriggered()
|
||||||
{
|
{
|
||||||
auto dialog = std::make_unique<SellerDialog>(this);
|
auto dialog = std::make_unique<SellerDialog>(this);
|
||||||
int retCode = dialog->exec();
|
int retCode = dialog->exec();
|
||||||
|
@ -71,7 +71,7 @@ void MainWindow::on_actionEditSeller_triggered()
|
||||||
static_cast<SaleModel*>(ui_.salesView->model()), &SaleModel::onBasketDataChanged);
|
static_cast<SaleModel*>(ui_.salesView->model()), &SaleModel::onBasketDataChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_paidButton_triggered()
|
void MainWindow::onPaidButtonTriggered()
|
||||||
{
|
{
|
||||||
if (marketplace_->basketSize() > 0) {
|
if (marketplace_->basketSize() > 0) {
|
||||||
QString lastPrice{marketplace_->getBasketSumAsString().c_str()};
|
QString lastPrice{marketplace_->getBasketSumAsString().c_str()};
|
||||||
|
@ -82,14 +82,14 @@ void MainWindow::on_paidButton_triggered()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_sellerNoEdit_checkSellerNo()
|
void MainWindow::onSellerNoEditCheckSellerNo()
|
||||||
{
|
{
|
||||||
using std::regex, std::regex_match, std::smatch;
|
using std::regex, std::regex_match, std::smatch;
|
||||||
|
|
||||||
auto inputText = ui_.sellerNoEdit->text().toStdString();
|
auto inputText = ui_.sellerNoEdit->text().toStdString();
|
||||||
|
|
||||||
if (inputText.empty()) {
|
if (inputText.empty()) {
|
||||||
on_paidButton_triggered();
|
onPaidButtonTriggered();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,9 @@ class MainWindow : public QMainWindow
|
||||||
void onCancelAllArticlesButtonClicked(bool checked);
|
void onCancelAllArticlesButtonClicked(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void on_actionEditSeller_triggered();
|
void onActionEditSellerTriggered();
|
||||||
void on_sellerNoEdit_checkSellerNo();
|
void onSellerNoEditCheckSellerNo();
|
||||||
void on_paidButton_triggered();
|
void onPaidButtonTriggered();
|
||||||
|
|
||||||
Ui::MainWindow ui_;
|
Ui::MainWindow ui_;
|
||||||
std::unique_ptr<Marketplace> marketplace_;
|
std::unique_ptr<Marketplace> marketplace_;
|
||||||
|
|
Loading…
Reference in a new issue