But none of this will happen if the app's event loop isn't running. So putting that code into main() before the QCoreApplication::exec() call will have no effect at all since there is no event loop yet to handle signals.