diff --git a/include/mymainwindow.h b/include/mymainwindow.h index 4189281..3e24591 100644 --- a/include/mymainwindow.h +++ b/include/mymainwindow.h @@ -43,6 +43,7 @@ private slots: void on_langCB_currentIndexChanged(const int &lang); void showStatusMessage(QString msg); void retranslate(); + void closeTask(); private: void init(); diff --git a/src/main.cpp b/src/main.cpp index 605f8bd..999def3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ #include +#include #include "mymainwindow.h" @@ -9,5 +10,6 @@ int main(int argc, char *argv[]) MyMainWindow w; w.show(); + QObject::connect(&a, SIGNAL(aboutToQuit()), &w, SLOT(closeTask())); return a.exec(); } diff --git a/src/mymainwindow.cpp b/src/mymainwindow.cpp index b645ba4..5710947 100644 --- a/src/mymainwindow.cpp +++ b/src/mymainwindow.cpp @@ -87,6 +87,11 @@ void MyMainWindow::closeEvent(QCloseEvent * event) event->accept(); } +void MyMainWindow::closeTask() +{ + saveSettings(); +} + /// Laden der gespeicherten Einstellungen aller Tabs void MyMainWindow::loadSettings() {