// PARAVIS : ParaView wrapper SALOME module
//
-// Copyright (C) 2010-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2010-2016 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// this also connects to the pvserver and instantiates relevant PV behaviors
}
- pvWnd->setShown( toShow );
+ pvWnd->setVisible( toShow );
if ( toShow ) pvWnd->setFocus();
}
{
QApplication::restoreOverrideCursor();
}
-
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
/*!
\brief Handler method for the output of messages.
*/
break;
}
}
-
+#else
+/*!
+ \brief Handler method for the output of messages.
+*/
+static void ParavisMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
+{
+ switch(type)
+ {
+ case QtDebugMsg:
+ vtkOutputWindow::GetInstance()->DisplayText(msg.toLatin1().constData());
+ break;
+ case QtWarningMsg:
+ vtkOutputWindow::GetInstance()->DisplayErrorText(msg.toLatin1().constData());
+ break;
+ case QtCriticalMsg:
+ vtkOutputWindow::GetInstance()->DisplayErrorText(msg.toLatin1().constData());
+ break;
+ case QtFatalMsg:
+ vtkOutputWindow::GetInstance()->DisplayErrorText(msg.toLatin1().constData());
+ break;
+ }
+}
+#endif
/*!
\brief Activate module.
\param study current study
*/
bool PVGUI_Module::activateModule( SUIT_Study* study )
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
myOldMsgHandler = qInstallMsgHandler(ParavisMessageOutput);
-
+#else
+ myOldMsgHandler = qInstallMessageHandler(ParavisMessageOutput);
+#endif
SUIT_ExceptionHandler::addCleanUpRoutine( paravisCleanUp );
storeCommonWindowsState();
SUIT_ExceptionHandler::removeCleanUpRoutine( paravisCleanUp );
if (myOldMsgHandler)
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
qInstallMsgHandler(myOldMsgHandler);
-
+#else
+ qInstallMessageHandler(myOldMsgHandler);
+#endif
restoreCommonWindowsState();
return LightApp_Module::deactivateModule( study );