I was trying to create a simple console application to try out Qt\'s XML parser. I started a project in VS2008 and got this template:
int main(int argc, char
You could fire an event into the quit() slot of your application even without connect(). This way, the event-loop does at least one turn and should process the events within your main()-logic:
#include
#include
int main(int argc, char *argv[])
{
QCoreApplication app( argc, argv );
// do your thing, once
QTimer::singleShot( 0, &app, &QCoreApplication::quit );
return app.exec();
}
Don't forget to place CONFIG += console
in your .pro-file, or set consoleApplication: true
in your .qbs Project.CppApplication.