The App store probably sends a SIGTERM
signal to notify your process to close. Because you are not handling it, nothing happens. You need to implement a unix signal handler as shown in this "Calling Qt Functions From Unix Signal Handlers" tutorial.
Something like this untested mess:
int setup_unix_signal_handlers()
{
struct sigaction term;
term.sa_handler = ::termSignalHandler;
sigemptyset(&term.sa_mask);
term.sa_flags |= SA_RESTART;
return sigaction(SIGTERM, &term, 0);
}
void termSignalHandler(int)
{
QCoreApplication::exit(0);
}
int main(int argc, char *argv[])
{
setup_unix_signal_handlers();
QCoreApplication a(argc, argv);
return a.exec();
}
Comprehensive explanation of signal handling : Simple Linux Signal Handling