What is the recommended way to exit an application in Qt? I find the documentation quite confusing and I am lost through the various examples that I saw on the Internet.
I want to close a database if it does not open and I want the code to exit right there at that time, not to continue with the rest of the code.
Should I use:
1. exit(EXIT_FAILURE);
2. QObject::connect(&myApp, &MyApplication::quitApplication, &app, &QCoreApplication::quit,Qt::QueuedConnection);
3. QObject::connect(&myApp, &MyApplication::exitApplication, &app, &QCoreApplication::exit,Qt::QueuedConnection);