Suppressing the console window: Does
Qt Code:
  1. CONFIG -= console
To copy to clipboard, switch view to plain text mode 
in your Pro file do it for you? Of course, you have to have somewhere for your cout and cerr streams to go.

If you don't enter the event loop, i.e. don't call QCoreApplication::exec(), then the program just runs straight through to completion.