关于 qt qDebug() 无输出问题的解决方法

在fedora 22下使用qt编写项目,结果发现Debug版本qDebug 没有输出,百度出在配置文件(.pro)中添加什么config += console 是没用的,google了半天发现是个bug,解决方法是建立一个配置文件:测试

touch ~/.config/QtProject/qtlogging.inigoogle

测试问题方法:spa

qDebug()<< "log test - Debug";debug

qWarning() << "log test - Warn";get

qCritical() << "log test - Critical";qt

qFatal( "log test - Fatal" );it

看看是否是输出:io

log test - Warnconsole

log test - Criticaltest

log test - Fatal


参考连接:

Bug 1227295 - no qDebug output

https://bugzilla.redhat.com/show_bug.cgi?id=1227295

[SOLVED] No output from qDebug(" why not.....")

https://forum.qt.io/topic/55645/solved-no-output-from-qdebug-why-not/12

相关文章
相关标签/搜索