Commit 2361a30e authored by Bryant's avatar Bryant

MessageHandler function prototype changed for Qt5.

parent 42a4ef8c
......@@ -52,10 +52,10 @@ This file is part of the QGROUNDCONTROL project
/// @brief Message handler which is installed using qInstallMsgHandler so you do not need
/// the MSFT debug tools installed to see qDebug(), qWarning(), qCritical and qAbort
void msgHandler( QtMsgType type, const char* msg )
void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
const char symbols[] = { 'I', 'E', '!', 'X' };
QString output = QString("[%1] %2").arg( symbols[type] ).arg( msg );
QString output = QString("[%1] in %2:%3 - \"%2\"").arg(symbols[type]).arg(context.file).arg(context.line).arg(msg);
std::cerr << output.toStdString() << std::endl;
if( type == QtFatalMsg ) abort();
}
......@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
// install the message handler
#ifdef Q_OS_WIN
qInstallMessageHandler( msgHandler );
qInstallMessageHandler(msgHandler);
#endif
// The following calls to qRegisterMetaType are done to silence debug output which warns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment