-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
32 lines (27 loc) · 1014 Bytes
/
mainwindow.cpp
File metadata and controls
32 lines (27 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
this->hide();
connect(ui->PbNext, &QPushButton::clicked, this, &MainWindow::Next);
}
void MainWindow::keyPressEvent(QKeyEvent *event) {
// Close application if 'delete' or 'Esc' button pressed
if (event->key() == Qt::Key_Delete || event->key() == Qt::Key_Escape) {
this->close();
} else {
QWidget::keyPressEvent(event);
}
}
void MainWindow::Next() {
whitelist = new class Whitelist(0, ui->SbStudentsAmount->value(),
ui->SbTasksAmount->value());
whitelist->setWindowTitle(QString("Generator V." +
QString::number(Data::version) + "." +
QString::number(Data::build)));
whitelist->hide();
this->hide(); // TODO
whitelist->show();
}
MainWindow::~MainWindow() { delete ui; }