I tried the following code snippet compiled with CONFIG += console set in the .pro file:
Qt Code:
  1. #include <QtGui>
  2. #include <QApplication>
  3.  
  4. #include <iostream>
  5.  
  6. #include <windows.h>
  7.  
  8. using namespace std;
  9.  
  10. int main(int argc, char *argv[])
  11. {
  12. QApplication a(argc, argv);
  13.  
  14. if(argc < 2)
  15. {
  16. cout << "GUI project" << endl;
  17. FreeConsole();
  18. w.show();
  19. }
  20. else
  21. {
  22. cout << "Console project" << endl;
  23. return 0;
  24. }
  25. return a.exec();
  26. }
To copy to clipboard, switch view to plain text mode 

Running from command line without arguments just opens the empty QMainWindow. The console where I called the program from shows output "Gui project".

Running from command line with an arbitrary argument just outputs "Console project" to the calling console.

Next use Explorer to start the executable. In this case, a new console and the empty QMainWindow appear. But due to the call to FreeConsole(), the new console gets removed quickly.

So if that "flickering" of the console is ok for you, this might be a solution.