下面看一下如何控制GUI程序控制台输出: 在 在.pro 文件中添加: CONFIG += console
CONFIG += console
选择:项目 -> 运行,勾选【Run in terminal】(在终端运行)选项。