Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
Add an event for the "Exit" menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainSwag101 committed Dec 25, 2017
1 parent 0b46ea7 commit f242e7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions stx_editor/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,10 @@ void MainWindow::on_actionSave_As_triggered()
{
SaveStxFileAs();
}

void MainWindow::on_actionExit_triggered()
{
this->close();
QApplication::closeAllWindows();
QApplication::exit();
}
2 changes: 2 additions & 0 deletions stx_editor/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ private slots:
void on_actionSave_triggered();
void on_actionSave_As_triggered();

void on_actionExit_triggered();

private:
bool CheckUnsaved();
void OpenStxFile();
Expand Down
2 changes: 1 addition & 1 deletion stx_editor/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
<string>STX Editor</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout">
Expand Down

0 comments on commit f242e7a

Please sign in to comment.