Hello ..

I have built a few Gui apps with QT and I am familiar with the concept of building
a main window and then building widgets and having them talk to each other ...
... but I am a little confused how I would write a
command line program using QCoreApplication.

If I subclassed QCoreApplication and had a main function like

Qt Code:
  1. #include "MyCoreApplication.h"
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. MyCoreApplication a(argc, argv);
  6.  
  7. return a.exec();
  8. }
To copy to clipboard, switch view to plain text mode 

Then what is the next step ? ... I want to pass my program some arguments
and then have it perform some tasks and then quit i.e. I don't believe I need
an event loop ... However the structure of the code is confusing me.

Would I put most of my core code now in the subclass of QCoreApplication
and then call exit() inside its constructor or one of its methods ?

As you can see I am confused on a very fundamental level so I would appreciate
if someone could post some code of just a simple command line app that
does something simple and then quits.

Thank you very much if you can help.

barnaby.