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:

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QCoreApplication app(argc, argv);
  4.  
  5. CLIClient *client = new CLIClient;
  6. client.run();
  7.  
  8. return app.exec();
  9. }
To copy to clipboard, switch view to plain text mode 

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?