
Originally Posted by
wysota
OK, thanks to everyone's answers, this was actually the explanation, to other people for the future I'll try to explain in simple terms how to exit the application, let's say we have an application that looks like this:
#include <QtCore/QCoreApplication>
#include <sasaja.h>
int main(int argc, char *argv[])
{
Sasaja sasaja;
return a.exec(); // This application would actually exit by itself after all the tasks have been finished if this line was not there.
}
#include <QtCore/QCoreApplication>
#include <sasaja.h>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Sasaja sasaja;
return a.exec(); // This application would actually exit by itself after all the tasks have been finished if this line was not there.
}
To copy to clipboard, switch view to plain text mode
So what do we do if we want the application to exit by itself after it's done it's jobs? Yeah, that's right, just remove or comment that line with like this:
#include <QtCore/QCoreApplication>
#include <sasaja.h>
int main(int argc, char *argv[])
{
Sasaja sasaja;
//return a.exec(); // now that this line is commented, the application will exit
}
#include <QtCore/QCoreApplication>
#include <sasaja.h>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Sasaja sasaja;
//return a.exec(); // now that this line is commented, the application will exit
}
To copy to clipboard, switch view to plain text mode
Hope this will help other people in the future too and thanks again to everyone who contributed to this.
Bookmarks