Linux specific Qt5 port

This commit is contained in:
wmayer
2016-12-13 19:47:32 +01:00
parent 5e375a6238
commit 87f2866884
4 changed files with 63 additions and 5 deletions

View File

@@ -1387,11 +1387,38 @@ _qt_msg_handler_old old_qtmsg_handler = 0;
#if QT_VERSION >= 0x050000
void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &qmsg)
{
Q_UNUSED(context);
const QChar *msg = qmsg.unicode();
#ifdef FC_DEBUG
switch (type)
{
case QtInfoMsg:
case QtDebugMsg:
Base::Console().Message("%s\n", msg);
break;
case QtWarningMsg:
Base::Console().Warning("%s\n", msg);
break;
case QtCriticalMsg:
Base::Console().Error("%s\n", msg);
break;
case QtFatalMsg:
Base::Console().Error("%s\n", msg);
abort(); // deliberately core dump
}
#ifdef FC_OS_WIN32
if (old_qtmsg_handler)
(*old_qtmsg_handler)(type, context, qmsg);
#endif
#else
// do not stress user with Qt internals but write to log file if enabled
Q_UNUSED(type);
Base::Console().Log("%s\n", msg);
#endif
}
#else
void messageHandler(QtMsgType type, const char *msg)
{
#endif
#ifdef FC_DEBUG
switch (type)
{
@@ -1410,18 +1437,15 @@ void messageHandler(QtMsgType type, const char *msg)
}
#ifdef FC_OS_WIN32
if (old_qtmsg_handler)
#if QT_VERSION >=0x050000
(*old_qtmsg_handler)(type, context, qmsg);
#else
(*old_qtmsg_handler)(type, msg);
#endif
#endif
#else
// do not stress user with Qt internals but write to log file if enabled
Q_UNUSED(type);
Base::Console().Log("%s\n", msg);
#endif
}
#endif
#ifdef FC_DEBUG // redirect Coin messages to FreeCAD
void messageHandlerCoin(const SoError * error, void * /*userdata*/)