diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ecb9468..8836b76 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -8,8 +8,10 @@ #define SPAWN_SPEED_INCREASE 100.0 #define MIN_SPAWN_SPEED 100.0 -MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow), leftArrowPressed{false}, rightArrowPressed{false}, m_spawnInterval{INIT_SPAWN_SPEED} { +MainWindow::MainWindow(QWidget* parent) : + QMainWindow(parent), ui(new Ui::MainWindow), leftArrowPressed{false}, rightArrowPressed{false}, m_spawnInterval{INIT_SPAWN_SPEED}, m_score{0} { ui->setupUi(this); + connect(ui->actionQuit, &QAction::triggered, qApp, &QApplication::quit); connect(&m_spawnTimer, &QTimer::timeout, this, &MainWindow::onBallSpawn); m_spawnTimer.start(m_spawnInterval); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 03943e0..4639c0c 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -23,8 +23,20 @@ 27 + + + File + + + + + + + Quit + +