Qt打开控制台输出
选择项目
选择Run、勾选Run in terminal
在pro文件中输入CONFIG +=console thread
CONFIG +=console thread
删除掉build文件夹再重新编译即可。