diff --git a/application/mainwindow.cpp b/application/mainwindow.cpp index a03046b..989eb1d 100644 --- a/application/mainwindow.cpp +++ b/application/mainwindow.cpp @@ -133,6 +133,12 @@ void MainWindow::showEvent(QShowEvent *evt) } } +void MainWindow::closeEvent(QCloseEvent *evt) +{ + Context::instance().destroy(); + evt->accept(); +} + void MainWindow::on_actionSettings_triggered() { SettingsForm *settings = new SettingsForm(this); diff --git a/application/mainwindow.h b/application/mainwindow.h index 220ef84..305ab1b 100644 --- a/application/mainwindow.h +++ b/application/mainwindow.h @@ -3,6 +3,7 @@ #include #include +#include #include "logindialog.h" @@ -40,6 +41,7 @@ private: // QWidget interface protected: void showEvent(QShowEvent *evt); + void closeEvent(QCloseEvent *evt) override; }; #endif // MAINWINDOW_H