我目前正在Windows 7 (64位,终极)上使用currently 3.2.1和QT5.3.2(按照我当前项目的要求)。我目前正在做一个GUI项目
我无法在应用程序输出窗口中看到任何qDebug消息,尽管我已经完成了以下操作:
我能知道我还应该尝试什么吗?谢谢!
发布于 2017-01-03 18:37:34
我没有收到任何由Qt中的
qDebug()输出的调试消息?那是什么原因呢?
通过自定义日志消息处理程序重新定义Qt应用程序中的标准Qt调试输出是很常见的,但我们仍然可以处理使调试消息到达调试控制台的问题:
// example for custom message handler
void customLogHandler(QtMsgType type, const QMessageLogContext& context,
const QString& msg)
{
// send the data to log file via the other thread
emit writeToFile(type, context, msg);
// now output to debugger console
#ifdef Q_OS_WIN
OutputDebugString(text.toStdWString().c_str());
#else
std::cerr << text.toStdString() << std::endl;
#endif
}
void main()
{
// custom handler start
qInstallMessageHandler(&customLogHandler);
// other app initializations
}发布于 2020-03-31 22:01:16
这是在Arch上为我做的。
Qt创建者>工具>选项>工具包,选择工具包,查找环境,单击change并添加:
QT_ASSUME_STDERR_HAS_CONSOLE=1现在,可以在应用程序输出中输出消息,如下所示:
qDebug() << "User clicked on the button!";

比你在节目中看到的要好:

https://stackoverflow.com/questions/41425530
复制相似问题