1.在.pro文件中添加CONFIG += console 2.在运行设置中勾选“Run in terminal” 在测试GUI程序时,想在控制台查看打印信息,设置上面两步就可以实现 转载于:https://www.cnblogs.com/JiaoAbel/p/8440423.html