int code = a.exec();SomeFunction();return code;
C++ (Qt)if (signo == SIGINT) { qApp->quit();}
C++ (Qt)QObject::connect(&app, &QCoreApplication::aboutToQuit, []() { // do something....});