3

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();
}

Specs :

  • Qt : 5.5.1
  • GCC : 5.3.1 (64bits)
  • CMake : 3.3.2
  • CLion : 1.2.2
usr1234567
  • 21,601
  • 16
  • 108
  • 128
Hello
  • 161
  • 1
  • 7
  • Please try including `` instead of ``, and try once again. Reference: http://doc.qt.io/qt-5/qtglobal.html#qDebug – Andrejs Cainikovs Dec 18 '15 at 12:29
  • I've rebuild the whole project after including `` instead of `` but it doesn't resolve the problem. – Hello Dec 18 '15 at 12:35
  • Which OS are you on? – Frank Osterfeld Dec 18 '15 at 15:00
  • 1
    I'm on Fedora 23 (4.2.6-301.fc23.x86_64). I've installed the same config on a Windows and it works. I think there is a problem with linux libraries. Maybe I haven't installed Qt properly on Fedora. – Hello Dec 18 '15 at 15:02
  • @Hello this is definitely useful/helpful thanks for posting. sry about other users downvoting. i gave an upvote. i ran into this issue when using `qtcreator`. – Trevor Boyd Smith Mar 03 '20 at 18:14
  • 1
    Does this answer your question? [qDebug not displaying anything](https://stackoverflow.com/questions/12799653/qdebug-not-displaying-anything) – Andrew Siplas Mar 28 '21 at 16:21

2 Answers2

10

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

[Rules]
*.debug=true

Related Bugzilla entry

Hello
  • 161
  • 1
  • 7
0

Try to enter ctrl+shift+alt+/ ->Registry and tick therun.processes.with.pty.