Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include <QDebug>
- MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
- {
- ui->setupUi(this);
- }
- MainWindow::~MainWindow()
- {
- delete ui;
- }
- void MainWindow::on_newproduct_clicked()
- {
- int a=ui->act1choose->currentIndex();
- std::string s=ui->lineEdit->text().toLocal8Bit().constData();;
- float n=ui->number->value();
- int u=ui->unitchoose->currentIndex();
- if(s != "") {
- Product p(s, static_cast<Units>(u), n, static_cast<Actions>(a));
- q.push(p);
- q.print();
- ui->delete_2->setEnabled(true);
- ui->newaction->setEnabled(true);
- ui->save->setEnabled(true);
- }
- }
- void MainWindow::on_newaction_clicked()
- {
- int a=ui->act2choose->currentIndex();
- q.push(Action(static_cast<Actions>(a)));
- q.print();
- }
- void MainWindow::on_delete_2_clicked()
- {
- q.pop();
- if(q.isEmpty()) {
- ui->delete_2->setEnabled(false);
- ui->newaction->setEnabled(false);
- ui->save->setEnabled(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement