简体   繁体   English

qDebug() 不打印任何东西

[英]qDebug() doesn't print anything

I try to use Qt with CLion.我尝试将 Qt 与 CLion 一起使用。 My problem is that qDebug() doesn't print anything, but qInfo(), qWarning(), qCritical() and qFatal() works well.我的问题是 qDebug() 不打印任何东西,但 qInfo()、qWarning()、qCritical() 和 qFatal() 运行良好。 Here is my example code:这是我的示例代码:

#include <QCoreApplication>
#include <QDebug>

int main(int argc, char *argv[]) {
    QCoreApplication a(argc, argv);

    qDebug() << "This will not appear";
    qInfo() << "This will appear";
    qWarning() << "This will appear too";
    qCritical() << "This will appear too";

    return a.exec();
}

Specs:眼镜:

  • Qt: 5.5.1 Qt:5.5.1
  • GCC: 5.3.1 (64bits) GCC:5.3.1(64 位)
  • CMake: 3.3.2 CMake:3.3.2
  • CLion: 1.2.2克里昂:1.2.2

Fixed by editing the ~/.config/QtProject/qtlogging.ini file as follows : 通过编辑〜/ .config / QtProject / qtlogging.ini文件来修复此问题,如下所示:

[Rules]
*.debug=true

Related Bugzilla entry 相关的Bugzilla条目

Try to enter ctrl+shift+alt+/ -> Registry and tick the run.processes.with.pty .尝试输入ctrl+shift+alt+/ -> Registry并勾选run.processes.with.pty

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM