Add File->Quit button
This commit is contained in:
parent
a5d465c533
commit
14da8dce44
2 changed files with 15 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -23,8 +23,20 @@
|
|||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionQuit">
|
||||
<property name="text">
|
||||
<string>Quit</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
Loading…
Add table
Reference in a new issue