From 2743568cef6a0949705c1b65dea157b422cd140b Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 25 Jul 2018 17:10:36 +0200 Subject: [PATCH] Connect ExitAction --- src/kiwixapp.cpp | 1 - src/mainwindow.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kiwixapp.cpp b/src/kiwixapp.cpp index b4bd46d..9d5357e 100644 --- a/src/kiwixapp.cpp +++ b/src/kiwixapp.cpp @@ -218,5 +218,4 @@ void KiwixApp::createAction() CREATE_ACTION_ICON(ExitAction, "exit", "Exit"); SET_SHORTCUT(ExitAction, QKeySequence::Quit); - DISABLE_ACTION(ExitAction); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3612c24..9101636 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -13,6 +13,9 @@ MainWindow::MainWindow(QWidget *parent) : { mp_ui->setupUi(this); mp_ui->tabWidget->tabBar()->setExpanding(false); + auto app = KiwixApp::instance(); + connect(app->getAction(KiwixApp::ExitAction), &QAction::triggered, + this, &QMainWindow::close); #if !SYSTEMTITLEBAR setWindowFlags(Qt::Window | Qt::CustomizeWindowHint); #endif