summaryrefslogtreecommitdiff
path: root/mainwin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mainwin.cc')
-rw-r--r--mainwin.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/mainwin.cc b/mainwin.cc
index 5ad510b..7abb4ed 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -158,6 +158,7 @@ MainWindow::MainWindow(const char *filename)
connect(this->fileActionSave, SIGNAL(triggered()), this, SLOT(actionSave()));
connect(this->fileActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs()));
connect(this->fileActionReload, SIGNAL(triggered()), this, SLOT(actionReload()));
+ connect(this->fileActionQuit, SIGNAL(triggered()), this, SLOT(quit()));
#ifndef __APPLE__
this->fileActionSave->setShortcut(QKeySequence(Qt::Key_F2));
this->fileActionReload->setShortcut(QKeySequence(Qt::Key_F3));
@@ -1790,3 +1791,10 @@ void MainWindow::setFont(const QString &family, uint size)
font.setStyleHint(QFont::TypeWriter);
editor->setFont(font);
}
+
+void MainWindow::quit()
+{
+ QCloseEvent ev;
+ QApplication::sendEvent(QApplication::instance(), &ev);
+ if (ev.isAccepted()) QApplication::instance()->quit();
+}
contact: Jan Huwald // Impressum