Quantcast
Channel: Qt DevNet forums: Installation and Deployment
Viewing all articles
Browse latest Browse all 2113

qDebug()

$
0
0
In the” QGlobal documentation”:http://qt-project.org/doc/qt-5.0/qtcore/qtglobal.html#qWarning, it says if you’d like to use the qDebug() << “blah” syntax, to #include <QtDebug>. My understanding is that when you do qDebug() or qWarning() with no arguments, that a QDebug object is returned which is a stream-like object. Ok, that makes sense. I did #include <QtDebug> successfully in a project on Mac OSX and used qDebug() << “blah”, although very strangely it would only work if it were at the top of the .cpp in which I actually used the qDebug(); I could not put the include a global header or ‘lower than other headers’ even in the same .cpp file. So, anyway, with this code that frailly works on a Mac OSX, I then try to compile it on Windows… In this case, I get a compiler error, ‘QMessageLogger::debug’ does not take 0 arguments. I have tried a few things haphazardly without success to make it work. I’ve tried to figure out what #include <QtDebug> is trying to do; so far, unsuccessfully. QtDebug just includes qdebug.h, which I’ve scanned, and nothing in that header is obvious to me in explaining how qDebug(), qWarning(), qCritical(), etc are set up to return a QDebug object when invoked with no arguments. Any suggestions?

Viewing all articles
Browse latest Browse all 2113

Trending Articles