MainWindow::MainWindow(QWidget *parent, Reception *reception) : QMainWindow(parent), _ui(new Ui::MainWindow), _reception(reception) { QTimer *timer = new QTimer(this); QTimer *day = new QTimer(this); timer->start(500); day->start(this->_reception->getPreparePizza() * this->_reception->getReplaceStock() * 30); this->_ui->setupUi(this); QObject::connect(this->_ui->actionQuit, SIGNAL(triggered()), this, SLOT(quitWindow())); QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quitWindow())); QObject::connect(this->_ui->tableKitchen, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), SLOT(switchItem(QListWidgetItem *, QListWidgetItem *))); QObject::connect(this->_ui->sliderPizzaNumber, SIGNAL(valueChanged(int)), this->_ui->pizzaNumber, SLOT(display(int))); QObject::connect(this->_ui->buttonOrder, SIGNAL(clicked()), SLOT(getOrderFromForm())); QObject::connect(this->_ui->linePizzaOrder, SIGNAL(returnPressed()), SLOT(getOrderFromLine())); QObject::connect(this->_ui->actionOpenMan, SIGNAL(triggered()), this, SLOT(openMan())); QObject::connect(this->_ui->actionOpenQt, SIGNAL(triggered()), this, SLOT(openQt())); QObject::connect(this->_ui->actionOpenLog, SIGNAL(triggered()), this, SLOT(openLog())); QObject::connect(this->_ui->actionAchievment, SIGNAL(triggered()), this, SLOT(openAchievment())); QObject::connect(timer, SIGNAL(timeout()), SLOT(refresh())); QObject::connect(day, SIGNAL(timeout()), SLOT(newDay())); };
void quit() { emit quitWindow(); }