titaniumdecoy
18th October 2009, 02:44
I am trying to write a console-based QtCore application but am unable to figure out how to do so.
According to the documentation, QCoreApplication should be used for command-line apps.
I have the following code:
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
CLIClient *client = new CLIClient;
client.run();
return app.exec();
}
client.run() contains a while loop which never exits which drives the command-line interface. However, since app.exec() is never called I can't use QProcess and other QtCore components.
How can I use the QCoreApplication event loop which is alluded to in the documentation?
According to the documentation, QCoreApplication should be used for command-line apps.
I have the following code:
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
CLIClient *client = new CLIClient;
client.run();
return app.exec();
}
client.run() contains a while loop which never exits which drives the command-line interface. However, since app.exec() is never called I can't use QProcess and other QtCore components.
How can I use the QCoreApplication event loop which is alluded to in the documentation?