From 2361a30e1d4a796d7a9b8a7d71df2e571816ec93 Mon Sep 17 00:00:00 2001 From: Bryant Date: Tue, 8 Jul 2014 23:43:06 -0700 Subject: [PATCH] MessageHandler function prototype changed for Qt5. --- src/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index db752a5fb..ab7d0c985 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 -- 2.22.0