How can I terminate a running Qt application (QCoreApplication
) when exit
does not work because the event loop is not yet started.
http://doc.qt.io/qt-5/qcoreapplication.html#exit
After this function has been called, the application leaves the main event loop and returns from the call to exec(). The exec() function returns returnCode. If the event loop is not running, this function does nothing
One (stupid?) approach I have found is to start the event loop and call QCoreApplication::exit again
, but is this my best option?