I am currently using QT Creator 3.2.1 with Qt 5.3.2 (as required by my current project) on Windows 7 (64 bits, Ultimate). I am currently working on a GUI project
I am unable to see any qDebug messages in the Application Output window despite already done the following:
May I know what else should I try? Thanks!
I don't get any debug messages supposed to be printed out by
qDebug()
in Qt Creator? What could be the reason for that?
It is common to redefine the standard Qt debug output in Qt apps via the custom log message handler but we can still take care of making debug messages to reach the debug console:
// example for custom message handler
void customLogHandler(QtMsgType type, const QMessageLogContext& context,
const QString& msg)
{
// send the data to log file via the other thread
emit writeToFile(type, context, msg);
// now output to debugger console
#ifdef Q_OS_WIN
OutputDebugString(text.toStdWString().c_str());
#else
std::cerr << text.toStdString() << std::endl;
#endif
}
void main()
{
// custom handler start
qInstallMessageHandler(&customLogHandler);
// other app initializations
}