Skip to content

Commit

Permalink
Add exit method
Browse files Browse the repository at this point in the history
  • Loading branch information
rattle99 committed Feb 9, 2019
1 parent c54d6f3 commit cd53ff2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions QtNotepad/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ void MainWindow::on_actionPrint_triggered()
}
ui->textEdit->print(&printer);
}

void MainWindow::on_actionExit_triggered()
{
QApplication::quit();
}
2 changes: 2 additions & 0 deletions QtNotepad/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ private slots:

void on_actionPrint_triggered();

void on_actionExit_triggered();

private:
Ui::MainWindow *ui;
QString currentFile = "";
Expand Down
1 change: 1 addition & 0 deletions QtNotepad/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<addaction name="actionOpen"/>
<addaction name="actionSave_As"/>
<addaction name="actionPrint"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuEdit">
Expand Down

0 comments on commit cd53ff2

Please sign in to comment.