diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-12-16 13:54:03 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-12-16 20:58:52 +0100 |
commit | c2317a1f99ff778010385aad11745eb75d6a1900 (patch) | |
tree | e58ed853022036130aece07baf62c14d38f68ac9 /gui/main.cpp | |
parent | a114b25c5720cedc93bec36e4fa822fe6cfa85b4 (diff) |
[bug] fix osx quits from app menu and dock
aboutToQuit let us catch Quits coming from the osx menu or the dock.
Diffstat (limited to 'gui/main.cpp')
-rw-r--r-- | gui/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gui/main.cpp b/gui/main.cpp index fe96caa..1cb2d0e 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -48,7 +48,6 @@ QString getAppName(QJsonValue info, QString provider) { auto handler = [](int sig) -> void { printf("\nCatched signal(%d): quitting\n", sig); - Quit(); QApplication::quit(); }; @@ -82,6 +81,11 @@ int main(int argc, char **argv) { app.setQuitOnLastWindowClosed(false); app.setAttribute(Qt::AA_UseHighDpiPixmaps); + QObject::connect(&app, &QApplication::aboutToQuit, []() { + qDebug() << ">>> Quitting, bye!"; + Quit(); + }); + #ifdef OS_WIN signal(SIGINT, handler); signal(SIGTERM, handler); |