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 SPAWN_SPEED_INCREASE 100.0
|
||||||
#define MIN_SPAWN_SPEED 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);
|
ui->setupUi(this);
|
||||||
|
connect(ui->actionQuit, &QAction::triggered, qApp, &QApplication::quit);
|
||||||
|
|
||||||
connect(&m_spawnTimer, &QTimer::timeout, this, &MainWindow::onBallSpawn);
|
connect(&m_spawnTimer, &QTimer::timeout, this, &MainWindow::onBallSpawn);
|
||||||
m_spawnTimer.start(m_spawnInterval);
|
m_spawnTimer.start(m_spawnInterval);
|
||||||
|
|
|
@ -23,8 +23,20 @@
|
||||||
<height>27</height>
|
<height>27</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QMenu" name="menuFile">
|
||||||
|
<property name="title">
|
||||||
|
<string>File</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionQuit"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuFile"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
<action name="actionQuit">
|
||||||
|
<property name="text">
|
||||||
|
<string>Quit</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue