Console output in a Qt GUI app?

前端 未结 17 1802
星月不相逢
星月不相逢 2020-11-28 07:06

I have a Qt GUI application running on Windows that allows command-line options to be passed and under some circumstances I want to output a message to the console and then

17条回答
  •  孤街浪徒
    2020-11-28 08:08

    One solution is to run powershell and redirect the output to whatever stream you want.

    Below is an example of running powershell from cmd.exe and redirecting my_exec.exe output to both the console and an output.txt file:

    powershell ".\my_exec.exe | tee output.txt"
    

提交回复
热议问题