For Qt Console apps, I have found it best to do the following:
1. Create a class with a void public slot that represents your main thread (or only thread). The slot should always exit with something like this:
return;
QCoreApplication::exit(#); // Where # is the exit code
return;
To copy to clipboard, switch view to plain text mode
2. Use a one shot timer in the main function to call the slot.
So your main function would look like this:
#include <QTimer>
int main(int argc, char *argv[])
{
Sasaja sasaja;
QTimer::singleShot(0,
&sasaja,
SLOT(DoWork
()));
return a.exec();
}
#include <QTimer>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Sasaja sasaja;
QTimer::singleShot(0, &sasaja, SLOT(DoWork()));
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Karl
Bookmarks