I compile my qt-project with += console option, I need it to debug version, and for release I rebuild project with -= console
But sometimes I need enable\show console output in release version of my app.
So my question is - Is it possible to pass some argument (line -show_console) to my .exe to start app with cons开发者_高级运维ole or without (if no option specified)?
I have an application with a GUI window and a console window. I open the console window using AllocConsole from the Windows API. The trouble is, Qt can't debug it, at least using gdb, because gdb needs a console too. But see my question here for a workaround.
If you mean you want a gui app that also writes to the console then under windows you need to reopen the console.
Alternatively - Set the application type to console ( ie /subsystem:console in windows) but still write the normal Qt gui code, it will open a console and you can use std::cout
精彩评论