Browse Source

MessageHandler function prototype changed for Qt5.

QGC4.4
Bryant 11 years ago
parent
commit
2361a30e1d
  1. 4
      src/main.cc

4
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 /// @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 /// 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' }; 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; std::cerr << output.toStdString() << std::endl;
if( type == QtFatalMsg ) abort(); if( type == QtFatalMsg ) abort();
} }

Loading…
Cancel
Save