qDebug 不显示任何内容 [英] qDebug not displaying anything

查看:141
本文介绍了qDebug 不显示任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常当我需要调试一些东西时,使用 qDebug() 打印一些东西会更容易,而不是使用调试器逐步调试.问题是有时 qDebug() 的输出根本不显示!qWarningqCritical 也是如此.奇怪的是,只有在正常运行项目时(Ctrl+R)才会出现,而在调试时(F5)出现输出.

Often when I need to debug something it's easier to print something using qDebug() instead of debugging step-by-step using a debugger. The problem is that from time to time the output of qDebug() isn't displayed at all! The same with qWarning and qCritical. What's strange, it only occurs when running the project normally (Ctrl+R), while when debugging (F5) the output shows up.

推荐答案

解决方案很简单:将 CONFIG += console 添加到您的 .pro 文件并重建整个项目.

The solution is simple: add CONFIG += console to your .pro file and rebuild the whole project.

这篇关于qDebug 不显示任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆