Skip to content

Commit

Permalink
Merge pull request #18 from JayBraker/RobertKrajewski#issue-863668034
Browse files Browse the repository at this point in the history
Connected helper "closeTask" to signal "aboutToQuit" so that settings…
  • Loading branch information
t-schroeder committed Jan 17, 2022
2 parents ea58911 + cf84d50 commit 721274d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/mymainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private slots:
void on_langCB_currentIndexChanged(const int &lang);
void showStatusMessage(QString msg);
void retranslate();
void closeTask();

private:
void init();
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <QApplication>
#include <QObject>

#include "mymainwindow.h"

Expand All @@ -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();
}
5 changes: 5 additions & 0 deletions src/mymainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ void MyMainWindow::closeEvent(QCloseEvent * event)
event->accept();
}

void MyMainWindow::closeTask()
{
saveSettings();
}

/// Laden der gespeicherten Einstellungen aller Tabs
void MyMainWindow::loadSettings()
{
Expand Down

0 comments on commit 721274d

Please sign in to comment.