qDebug()不打印任何内容 [英] qDebug() doesn't print anything

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

问题描述

我尝试将Qt与CLion一起使用.我的问题是qDebug()不会打印任何内容,但是qInfo(),qWarning(),qCritical()和qFatal()效果很好.这是我的示例代码:

I try to use Qt with CLion. My problem is that qDebug() doesn't print anything, but qInfo(), qWarning(), qCritical() and qFatal() works well. 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();
}

规格:

  • Qt:5.5.1
  • GCC:5.3.1(64位)
  • CMake:3.3.2
  • CLion:1.2.2

推荐答案

通过按如下所示编辑〜/.config/QtProject/qtlogging.ini文件进行修复:

Fixed by editing the ~/.config/QtProject/qtlogging.ini file as follows :

[Rules]
*.debug=true

相关的Bugzilla条目

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

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