viewMgr->getActiveView()->setFocus();
return 0;
} else {
- viewMgr = new PVViewer_ViewManager( activeStudy(), desktop(), logWindow() );
+ viewMgr = new PVViewer_ViewManager( activeStudy(), desktop() );
}
}
#endif
else if ( flag == WT_LogWindow )
{
LogWindow* logWin = new LogWindow( desktop() );
+ logWin->handleQtMessages( true );
logWin->setObjectName( "logWindow" );
logWin->setWindowTitle( tr( "LOG_WINDOW" ) );
logWin->setProperty( "shortcut", QKeySequence( "Alt+Shift+L" ) );
#include <QDate>
#include <QFile>
#include <QMenu>
+#include <QTextBlock>
#include <QTextEdit>
#include <QTextStream>
#include <QTime>
#define DEFAULT_SEPARATOR "***"
-/*!
- \brief Convert rich text to plain text.
- \internal
- \param richText rich text string
- \return converted plain text string
-*/
-static QString plainText( const QString& richText )
+namespace
{
- QString aText = richText;
- int startTag = aText.indexOf( '<' );
- while ( true )
+ /*!
+ \brief Convert rich text to plain text.
+ \internal
+ \param richText rich text string
+ \return converted plain text string
+ */
+ QString plainText( const QString& richText )
{
- if ( startTag < 0 )
- break;
-
- int finishTag = aText.indexOf( '>', startTag );
- if ( finishTag < 0 )
- break;
-
- aText = aText.remove( startTag, finishTag - startTag + 1 );
- startTag = aText.indexOf( '<' );
+ QString aText = richText;
+ int startTag = aText.indexOf( '<' );
+ while ( true )
+ {
+ if ( startTag < 0 )
+ break;
+
+ int finishTag = aText.indexOf( '>', startTag );
+ if ( finishTag < 0 )
+ break;
+
+ aText = aText.remove( startTag, finishTag - startTag + 1 );
+ startTag = aText.indexOf( '<' );
+ }
+ return aText;
}
- return aText;
}
/*!
\param parent parent widget
*/
LogWindow::LogWindow( QWidget* parent )
-: QWidget( parent ),
- SUIT_PopupClient()
+ : QWidget( parent ), SUIT_PopupClient(), QtxMsgHandlerCallback( false )
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myView = new QTextEdit( this );
myView->setReadOnly( true );
myView->viewport()->installEventFilter( this );
+ myView->setPlaceholderText( "Message Log" );
QVBoxLayout* main = new QVBoxLayout( this );
main->setMargin( 0 );
main->addWidget( myView );
- myBannerSize = 0;
- myBanner = "<b>Message Log</b>\n********************";
mySeparator = DEFAULT_SEPARATOR;
clear();
}
/*!
- \brief Get current banner (message log window header text).
+ \brief Get current banner (text shown when log window is empty).
\return string representing the current banner
*/
QString LogWindow::banner() const
{
- return myBanner;
+ return myView->placeholderText();
}
/*!
}
/*!
- \brief Set current banner (message log window header text).
+ \brief Set current banner (text shown when log window is empty).
\param banner new banner
*/
void LogWindow::setBanner( const QString& banner )
{
- myBanner = banner;
-
- clear( false );
+ myView->setPlaceholderText( banner );
}
/*!
if ( !dateTime.isEmpty() )
msg = QString( "[%1] %2" ).arg( dateTime ).arg( msg );
- myView->append( msg );
+ append( msg );
myHistory.append( plainText( message ) );
if ( flags & DisplaySeparator && !mySeparator.isEmpty() )
{
- myView->append( mySeparator ); // add separator
+ // add separator
+ append( mySeparator );
myHistory.append( plainText( mySeparator ) );
}
myView->moveCursor( QTextCursor::End );
}
+/*!
+ \brief Append text to the log window.
+ \param text Text being added.
+*/
+void LogWindow::append( const QString text )
+{
+ if ( !text.isEmpty() )
+ {
+ myView->append( text );
+ QTextBlock block = myView->document()->lastBlock();
+ QTextCursor cursor( block );
+ QTextBlockFormat format = cursor.blockFormat();
+ format.setBottomMargin( 10 );
+ cursor.setBlockFormat( format );
+ }
+}
+
/*!
\brief Clear message log.
\param clearHistory if True, clear also the messages history
myView->clear();
if ( clearHistory )
myHistory.clear();
-
- if ( !myBanner.isEmpty() )
- {
- myView->append( myBanner );
- myBannerSize = myView->document()->blockCount();
- }
- else
- myBannerSize = 0;
}
/*!
void LogWindow::updateActions()
{
myActions[CopyId]->setEnabled( myView->textCursor().hasSelection() );
- myActions[ ClearId ]->setEnabled( myView->document()->blockCount() > myBannerSize );
+ myActions[ ClearId ]->setEnabled( !myView->document()->isEmpty() );
myActions[SelectAllId]->setEnabled( !myView->document()->isEmpty() );
myActions[ SaveToFileId ]->setEnabled( myHistory.count() > 0 );
}
return ret;
}
+/*!
+ \brief Activate/deactivate Qt messages handling.
+ \param on If \c true, Qt messags are handled by log window.
+*/
+void LogWindow::handleQtMessages(bool on)
+{
+ if ( on )
+ activate();
+ else
+ deactivate();
+}
+
+/*!
+ \brief Handle Qt messages.
+ \param type Qt message type.
+ \param context Message context.
+ \param message Message text.
+*/
+void LogWindow::qtMessage( QtMsgType type, const QMessageLogContext&, const QString& message )
+{
+ QColor color;
+ switch ( type )
+ {
+ case QtInfoMsg:
+ color = QColor("#008000"); // dark green
+ break;
+ case QtCriticalMsg:
+ color = QColor("#ff0000"); // red
+ break;
+ case QtFatalMsg:
+ color = QColor("#800000"); // dark red
+ break;
+ case QtWarningMsg:
+ color = QColor("#ff9000"); // orange
+ break;
+ case QtDebugMsg:
+ default:
+ color = QColor("#000000"); // black
+ break;
+ }
+ putMessage( message, color, DisplayNormal);
+}
+
/*!
\fn virtual QString LogWindow::popupClientType() const;
\brief Get popup client symbolic name, used in popup menu management system.
# define LOGWINDOW_EXPORT
#endif
-#include <SUIT_PopupClient.h>
+#include "QtxMsgHandler.h"
+#include "SUIT_PopupClient.h"
#include <QWidget>
#include <QMap>
class QAction;
class QTextEdit;
-class LOGWINDOW_EXPORT LogWindow : public QWidget, public SUIT_PopupClient
+class LOGWINDOW_EXPORT LogWindow : public QWidget, public SUIT_PopupClient, public QtxMsgHandlerCallback
{
Q_OBJECT
};
public:
- LogWindow( QWidget* theParent );
+ LogWindow( QWidget* );
virtual ~LogWindow();
virtual QString popupClientType() const { return QString( "LogWindow" ); }
void setMenuActions( const int );
int menuActions() const;
+ void handleQtMessages(bool);
+
protected slots:
void onSaveToFile();
void onSelectAll();
void onCopy();
private:
+ void append( const QString text );
void createActions();
void updateActions();
+ void qtMessage( QtMsgType, const QMessageLogContext&, const QString& );
private:
QTextEdit* myView; //!< internal view window
# --- options ---
INCLUDE_DIRECTORIES(
- ${PROJECT_SOURCE_DIR}/src/SUIT
- ${PROJECT_SOURCE_DIR}/src/STD
${PROJECT_SOURCE_DIR}/src/Qtx
- ${PROJECT_SOURCE_DIR}/src/Event
- ${PROJECT_SOURCE_DIR}/src/PyInterp
+ ${PROJECT_SOURCE_DIR}/src/SUIT
${PROJECT_SOURCE_DIR}/src/PVServerService
- ${CMAKE_SOURCE_DIR}/src/LogWindow
)
ADD_DEFINITIONS(
SET(_link_LIBRARIES
${KERNEL_SALOMELocalTrace}
${KERNEL_OpUtil}
- PyInterp
suit
- Event
PVServerService
pqApplicationComponents
#vtkRenderingFreeTypeOpenGL
# header files / no moc processing
SET(_other_HEADERS
PVViewer.h
- PVViewer_LogWindowAdapter.h
+ PVViewer_OutputWindow.h
PVViewer_Core.h
)
# header files / to install
PVViewer_ViewManager.cxx
PVViewer_ViewModel.cxx
PVViewer_ViewWindow.cxx
- PVViewer_LogWindowAdapter.cxx
+ PVViewer_OutputWindow.cxx
PVViewer_Behaviors.cxx
PVViewer_GUIElements.cxx
PVViewer_Core.cxx
#define PVVIEWER_H
#ifdef WIN32
-#if defined PVViewer_EXPORTS
-#define PVVIEWER_EXPORT __declspec(dllexport)
+# if defined PVVIEWER_EXPORTS || defined PVViewer_EXPORTS
+# define PVVIEWER_EXPORT __declspec(dllexport)
+# else
+# define PVVIEWER_EXPORT __declspec(dllimport)
+# endif
#else
-#define PVVIEWER_EXPORT __declspec(dllimport)
-#endif
-#else
-#define PVVIEWER_EXPORT
+# define PVVIEWER_EXPORT
#endif
-#endif //PVVIEWER_H
+#endif // PVVIEWER_H
// Author: Adrien Bruneton (CEA)
-#ifndef PVGUIBEHAVIORS_H_
-#define PVGUIBEHAVIORS_H_
+#ifndef PVVIEWER_BEHAVIORS_H
+#define PVVIEWER_BEHAVIORS_H
#include "PVViewer.h"
Q_OBJECT
public:
- PVViewer_Behaviors(QMainWindow * parent);
+ PVViewer_Behaviors(QMainWindow*);
- void instanciateMinimalBehaviors(QMainWindow * desk);
- void instanciateAllBehaviors(QMainWindow * desk);
+ void instanciateMinimalBehaviors(QMainWindow*);
+ void instanciateAllBehaviors(QMainWindow*);
virtual ~PVViewer_Behaviors() {}
static int BehaviorLoadingLevel;
};
-#endif /* PVGUIBEHAVIORS_H_ */
+#endif // PVVIEWER_BEHAVIORS_H
//
#include "PVViewer_Core.h"
-#include "PVViewer_LogWindowAdapter.h"
+#include "PVViewer_OutputWindow.h"
#include "PVViewer_GUIElements.h"
#include "PVViewer_Behaviors.h"
#include "PVViewer_Core.h"
\param fullSetup whether to instanciate all behaviors or just the minimal ones.
\return \c true if ParaView has been initialized successfully, otherwise false
*/
-bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindow)
+bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop)
{
if ( ! MyCoreApp) {
// Obtain command-line arguments
}
// Direct VTK log messages to our SALOME window - TODO: review this
- PVViewer_LogWindowAdapter * w = PVViewer_LogWindowAdapter::New();
- w->setLogWindow(logWindow);
+ PVViewer_OutputWindow * w = PVViewer_OutputWindow::New();
vtkOutputWindow::SetInstance(w);
new pqTabbedMultiViewWidget(); // registers a "MULTIVIEW_WIDGET" on creation
//
// Author : Adrien Bruneton (CEA)
-#ifndef SRC_PVVIEWER_PVVIEWER_CORE_H_
-#define SRC_PVVIEWER_PVVIEWER_CORE_H_
+#ifndef PVVIEWER_CORE_H
+#define PVVIEWER_CORE_H
#include "PVViewer.h"
class PVServer_ServiceWrapper;
class PVViewer_Behaviors;
-class LogWindow;
class QMainWindow;
class pqPVApplicationCore;
class PVVIEWER_EXPORT PVViewer_Core
{
public:
- static pqPVApplicationCore * GetPVApplication();
-
+ static pqPVApplicationCore* GetPVApplication();
//! Initialize ParaView if not yet done (once per session)
- static bool ParaviewInitApp(QMainWindow* aDesktop, LogWindow * w);
- static void ParaviewInitBehaviors(bool fullSetup=false, QMainWindow* aDesktop=0);
- static void ParaviewLoadConfigurations(const QString & configPath, bool force=false);
- static void ParaviewCleanup();
+ static bool ParaviewInitApp(QMainWindow*);
+ static void ParaviewInitBehaviors(bool = false, QMainWindow* = 0);
+ static void ParaviewLoadConfigurations(const QString&, bool = false);
+ static void ParaviewCleanup();
private:
PVViewer_Core();
static pqPVApplicationCore* MyCoreApp;
static bool ConfigLoaded;
- static PVViewer_Behaviors * ParaviewBehaviors;
+ static PVViewer_Behaviors* ParaviewBehaviors;
};
-#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */
+#endif // PVVIEWER_CORE_H
PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0;
-PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desk) :
- myDesktop(desk),
+PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desktop) :
propertiesPanel(0),
pipelineBrowserWidget(0),
pipelineModel(0),
filtersMenu(0),
macrosMenu(0),
catalystMenu(0),
- myPVWidgetsFlag(false)
+ mainToolBar(0),
+ vcrToolbar(0),
+ timeToolbar(0),
+ colorToolbar(0),
+ reprToolbar(0),
+ cameraToolbar(0),
+ axesToolbar(0),
+ macrosToolbar(0),
+ commonToolbar(0),
+ dataToolbar(0),
+ myDesktop(desktop),
+ myPVWidgetsFlag(false),
+ mainAction(0),
+ vcrAction(0),
+ timeAction(0),
+ colorAction(0),
+ reprAction(0),
+ cameraAction(0),
+ axesAction(0),
+ macrosAction(0),
+ commonAction(0),
+ dataAction(0)
{
}
//
// Author: Adrien Bruneton (CEA)
-#ifndef PVVIEWERGUIELEMENTS_H_
-#define PVVIEWERGUIELEMENTS_H_
+#ifndef PVVIEWER_GUIELEMENTS_H
+#define PVVIEWER_GUIELEMENTS_H
#include "PVViewer.h"
#include <QObject>
#include <QList>
-class pqPropertiesPanel;
-class pqPipelineBrowserWidget;
-class pqPipelineModel;
+class QAction;
class QMainWindow;
class QMenu;
class QToolBar;
-class QAction;
class pqAnimationTimeToolbar;
+class pqPipelineBrowserWidget;
+class pqPipelineModel;
+class pqPropertiesPanel;
class pqVCRToolbar;
/*!
Q_OBJECT
public:
- static PVViewer_GUIElements * GetInstance(QMainWindow * desk);
+ static PVViewer_GUIElements* GetInstance(QMainWindow*);
- pqPropertiesPanel * getPropertiesPanel();
- pqPipelineBrowserWidget * getPipelineBrowserWidget();
+ pqPropertiesPanel* getPropertiesPanel();
+ pqPipelineBrowserWidget* getPipelineBrowserWidget();
QMenu* getFiltersMenu();
QMenu* getSourcesMenu();
pqVCRToolbar* getVCRToolbar();
pqAnimationTimeToolbar* getTimeToolbar();
- void setToolBarVisible(bool show);
- void setToolBarEnabled(bool enabled);
+ void setToolBarVisible(bool);
+ void setToolBarEnabled(bool);
QList<QToolBar*> getToolbars();
- void setVCRTimeToolBarVisible(bool show);
+ void setVCRTimeToolBarVisible(bool);
private:
- PVViewer_GUIElements(QMainWindow* desk);
+ PVViewer_GUIElements(QMainWindow*);
virtual ~PVViewer_GUIElements() {}
static PVViewer_GUIElements* theInstance;
QToolBar* dataToolbar;
QMainWindow* myDesktop;
- bool myPVWidgetsFlag;
+ bool myPVWidgetsFlag;
public:
QAction* mainAction;
QAction* dataAction;
};
-#endif /* PVVIEWERGUIELEMENTS_H_ */
+#endif // PVVIEWER_GUIELEMENTS_H
bool PVViewer_InitSingleton::IS_INIT=false;
-void PVViewer_InitSingleton::Init(QMainWindow *aDesktop, LogWindow *logWindow)
+void PVViewer_InitSingleton::Init(QMainWindow* desktop)
{
if(IS_INIT)
return ;
- PVViewer_Core::ParaviewInitApp(aDesktop,logWindow);
+ PVViewer_Core::ParaviewInitApp(desktop);
// Finish ParaView set up: behaviors, connection and configurations.
const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
- PVViewer_Core::ParaviewInitBehaviors(true,aDesktop);
- PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop);
+ PVViewer_Core::ParaviewInitBehaviors(true, desktop);
+ PVViewer_ViewManager::ConnectToExternalPVServer(desktop);
PVViewer_Core::ParaviewLoadConfigurations(configPath);
IS_INIT=true;
}
//
// Author : Anthony GEAY (EDF R&D)
-#ifndef __PVVIEWER_INITSINGLETON_H__
-#define __PVVIEWER_INITSINGLETON_H__
+#ifndef PVVIEWER_INITSINGLETON_H
+#define PVVIEWER_INITSINGLETON_H
#include "PVViewer.h"
class QMainWindow;
-class LogWindow;
/**
* This class deals with initialization of SALOME_Session to make it a PV based application.
class PVVIEWER_EXPORT PVViewer_InitSingleton
{
public:
- static void Init(QMainWindow *aDesktop, LogWindow *logWindow);
+ static void Init(QMainWindow*);
private:
static bool IS_INIT;
};
-#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */
+#endif // PVVIEWER_INITSINGLETON_H
+++ /dev/null
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "PVViewer_LogWindowAdapter.h"
-
-#include <vtkObjectFactory.h>
-
-#include <LogWindow.h>
-#include <LogWindow.h>
-#include <SUIT_Session.h>
-#include <SALOME_Event.h>
-
-vtkStandardNewMacro(PVViewer_LogWindowAdapter);
-
-/*!
- * Put the message in the log window.
- */
-class TEvent: public SALOME_Event {
- LogWindow* myWindow;
- QString myMsg;
- QColor myColor;
- int myFlags;
- public:
- TEvent( LogWindow* theWindow, const QString theMsg, const QColor theColor, const int flags) :
- myWindow ( theWindow ),
- myMsg ( theMsg ),
- myColor ( theColor ),
- myFlags (flags)
- {}
-
- virtual void Execute() {
- if(myWindow)
- myWindow->putMessage(myMsg, myColor, myFlags);
- }
-};
-
-
-PVViewer_LogWindowAdapter::PVViewer_LogWindowAdapter() :
- TextCount(0),
- ErrorCount(0),
- WarningCount(0),
- GenericWarningCount(0),
- logWindow(0)
-{
-}
-
-PVViewer_LogWindowAdapter::~PVViewer_LogWindowAdapter()
-{
-}
-
-const unsigned int PVViewer_LogWindowAdapter::getTextCount()
-{
- return this->TextCount;
-}
-
-const unsigned int PVViewer_LogWindowAdapter::getErrorCount()
-{
- return this->ErrorCount;
-}
-
-const unsigned int PVViewer_LogWindowAdapter::getWarningCount()
-{
- return this->WarningCount;
-}
-
-const unsigned int PVViewer_LogWindowAdapter::getGenericWarningCount()
-{
- return this->GenericWarningCount;
-}
-
-void PVViewer_LogWindowAdapter::DisplayText(const char* text)
-{
- ++this->TextCount;
- ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkGreen, LogWindow::DisplayNormal ));
-}
-
-void PVViewer_LogWindowAdapter::DisplayErrorText(const char* text)
-{
- ++this->ErrorCount;
- ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkRed, LogWindow::DisplayNormal ));
-}
-
-void PVViewer_LogWindowAdapter::DisplayWarningText(const char* text)
-{
- ++this->WarningCount;
- ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::black, LogWindow::DisplayNormal ));
-}
-
-void PVViewer_LogWindowAdapter::DisplayGenericWarningText(const char* text)
-{
- ++this->GenericWarningCount;
- ProcessVoidEvent( new TEvent( getLogWindow() , text, Qt::black, LogWindow::DisplayNormal ));
-}
+++ /dev/null
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _PVViewer_LogWindowAdapter_h
-#define _PVViewer_LogWindowAdapter_h
-
-#include "PVViewer.h"
-
-#include <vtkOutputWindow.h>
-
-class LogWindow;
-
-/*!
-vtkOutputWindow implementation that puts VTK output messages to SALOME log window.
-
-To use, create an instance of PVViewer_LogWindowAdapter and pass it to the
-vtkOutputWindow::setInstance() static method.
-
-This class is based on pqOutputWindow ParaView class.
-*/
-class PVVIEWER_EXPORT PVViewer_LogWindowAdapter : public vtkOutputWindow
-{
-public:
- static PVViewer_LogWindowAdapter *New();
- vtkTypeMacro(PVViewer_LogWindowAdapter, vtkOutputWindow);
-
- //! Returns the number of text messages received
- const unsigned int getTextCount();
- //! Returns the number of error messages received
- const unsigned int getErrorCount();
- //! Returns the number of warning messages received
- const unsigned int getWarningCount();
- //! Returns the number of generic warning messages received
- const unsigned int getGenericWarningCount();
-
- void setLogWindow( LogWindow* w) { logWindow = w; }
- LogWindow* getLogWindow() { return logWindow; }
-
-private:
- PVViewer_LogWindowAdapter();
- PVViewer_LogWindowAdapter(const PVViewer_LogWindowAdapter&);
- PVViewer_LogWindowAdapter& operator=(const PVViewer_LogWindowAdapter&);
- ~PVViewer_LogWindowAdapter();
-
- unsigned int TextCount;
- unsigned int ErrorCount;
- unsigned int WarningCount;
- unsigned int GenericWarningCount;
- LogWindow * logWindow;
-
- virtual void DisplayText(const char*);
- virtual void DisplayErrorText(const char*);
- virtual void DisplayWarningText(const char*);
- virtual void DisplayGenericWarningText(const char*);
-};
-
-#endif // !_PVViewer_LogWindowAdapter_h
--- /dev/null
+// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "PVViewer_OutputWindow.h"
+
+#include <vtkObjectFactory.h>
+
+vtkStandardNewMacro(PVViewer_OutputWindow);
+
+PVViewer_OutputWindow::PVViewer_OutputWindow()
+{
+}
+
+PVViewer_OutputWindow::~PVViewer_OutputWindow()
+{
+}
+
+const unsigned int PVViewer_OutputWindow::getTextCount()
+{
+ return count(MESSAGE_TYPE_TEXT);
+}
+
+const unsigned int PVViewer_OutputWindow::getErrorCount()
+{
+ return count(MESSAGE_TYPE_ERROR);
+}
+
+const unsigned int PVViewer_OutputWindow::getWarningCount()
+{
+ return count(MESSAGE_TYPE_WARNING);
+}
+
+const unsigned int PVViewer_OutputWindow::getGenericWarningCount()
+{
+ return count(MESSAGE_TYPE_GENERIC_WARNING);
+}
+
+const unsigned int PVViewer_OutputWindow::getDebugCount()
+{
+ return count(MESSAGE_TYPE_DEBUG);
+}
+
+void PVViewer_OutputWindow::DisplayText(const char* text)
+{
+ MessageTypes type = GetCurrentMessageType();
+ myCounter[type] = count(type) + 1;
+ switch (type)
+ {
+ case MESSAGE_TYPE_ERROR:
+ qCritical(text);
+ break;
+ case MESSAGE_TYPE_WARNING:
+ case MESSAGE_TYPE_GENERIC_WARNING:
+ qWarning(text);
+ break;
+ case MESSAGE_TYPE_DEBUG:
+ qDebug(text);
+ break;
+ case MESSAGE_TYPE_TEXT:
+ default:
+ qInfo(text);
+ break;
+ }
+}
+
+int PVViewer_OutputWindow::count(const MessageTypes& type)
+{
+ return myCounter.value(type, 0);
+}
--- /dev/null
+// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef PVVIEWER_OUTPUTWINDOW_H
+#define PVVIEWER_OUTPUTWINDOW_H
+
+#include "PVViewer.h"
+
+#include <QMap>
+#include <vtkOutputWindow.h>
+
+/**
+ vtkOutputWindow implementation that redirects VTK output messages
+ to dedicated sinals which are then handled by SALOME log window.
+
+ To use, create an instance of PVViewer_OutputWindow and pass it to the
+ vtkOutputWindow::setInstance() static method.
+
+ This class is based on pqOutputWindow ParaView class.
+ */
+class PVVIEWER_EXPORT PVViewer_OutputWindow : public vtkOutputWindow
+{
+public:
+ static PVViewer_OutputWindow* New();
+ vtkTypeMacro(PVViewer_OutputWindow, vtkOutputWindow);
+
+ //! Returns the number of text messages received
+ const unsigned int getTextCount();
+ //! Returns the number of error messages received
+ const unsigned int getErrorCount();
+ //! Returns the number of warning messages received
+ const unsigned int getWarningCount();
+ //! Returns the number of generic warning messages received
+ const unsigned int getGenericWarningCount();
+ //! Returns the number of debug messages received
+ const unsigned int getDebugCount();
+
+private:
+ PVViewer_OutputWindow();
+ PVViewer_OutputWindow(const PVViewer_OutputWindow&);
+ PVViewer_OutputWindow& operator=(const PVViewer_OutputWindow&);
+ ~PVViewer_OutputWindow();
+
+ QMap<MessageTypes, int> myCounter;
+
+ void DisplayText(const char*);
+ int count(const MessageTypes&);
+};
+
+#endif // PVVIEWER_OUTPUTWINDOW_H
#include <utilities.h>
-#include <LogWindow.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_Study.h>
-#include <SUIT_Session.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
+#include "SUIT_Desktop.h"
+#include "SUIT_Study.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include <pqServer.h>
#include <pqServerConnectReaction.h>
/*!
Constructor
*/
-PVViewer_ViewManager::PVViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* desk, LogWindow * logWindow )
-: SUIT_ViewManager( study, desk, new PVViewer_Viewer() ),
- desktop(desk)
+PVViewer_ViewManager::PVViewer_ViewManager(SUIT_Study* study, SUIT_Desktop* desktop)
+: SUIT_ViewManager( study, desktop, new PVViewer_Viewer() )
{
MESSAGE("PVViewer - view manager created ...")
setTitle( tr( "PARAVIEW_VIEW_TITLE" ) );
// Initialize minimal paraview stuff (if not already done)
- PVViewer_InitSingleton::Init(desk, logWindow);
+ PVViewer_InitSingleton::Init(desktop);
- connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+ connect( desktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
}
-
PVServer_ServiceWrapper * PVViewer_ViewManager::GetService()
{
return PVServer_ServiceWrapper::GetInstance();
return resMgr->stringValue("resources", "PVViewer", QString());
}
-bool PVViewer_ViewManager::ConnectToExternalPVServer(QMainWindow* aDesktop)
+bool PVViewer_ViewManager::ConnectToExternalPVServer(QMainWindow* desktop)
{
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
bool noConnect = aResourceMgr->booleanValue( "PARAVIS", "no_ext_pv_server", false );
pqServer* server = pqActiveObjects::instance().activeServer();
if (server && server->isRemote())
- {
- // Already connected to an external server, do nothing
- MESSAGE("connectToExternalPVServer(): Already connected to an external PVServer, won't reconnect.");
- return false;
- }
+ {
+ // Already connected to an external server, do nothing
+ MESSAGE("connectToExternalPVServer(): Already connected to an external PVServer, won't reconnect.");
+ return false;
+ }
if (GetService()->GetGUIConnected())
- {
- // Should never be there as the above should already tell us that we are connected.
- std::stringstream msg2;
- msg2 << "Internal error while connecting to the pvserver.";
- msg2 << "ParaView doesn't see a connection, but PARAVIS engine tells us there is already one!" << std::endl;
- qWarning(msg2.str().c_str()); // will go to the ParaView console (see ParavisMessageOutput below)
- SUIT_MessageBox::warning( aDesktop,
- QString("Error connecting to PVServer"), QString(msg2.str().c_str()));
- return false;
- }
+ {
+ // Should never be there as the above should already tell us that we are connected.
+ std::stringstream msg2;
+ msg2 << "Internal error while connecting to the pvserver.";
+ msg2 << "ParaView doesn't see a connection, but PARAVIS engine tells us there is already one!" << std::endl;
+ qWarning(msg2.str().c_str()); // will go to the ParaView console (see ParavisMessageOutput below)
+ SUIT_MessageBox::warning( desktop,
+ QString("Error connecting to PVServer"), QString(msg2.str().c_str()));
+ return false;
+ }
std::stringstream msg;
QString serverUrlEnv = getenv("PARAVIEW_PVSERVER_URL");
std::string serverUrl;
if (!serverUrlEnv.isEmpty())
+ {
serverUrl = serverUrlEnv.toStdString();
+ }
else
- {
- // Get the URL from the engine (possibly starting the pvserver)
- serverUrl = GetService()->FindOrStartPVServer(0); // take the first free port
- }
-
+ {
+ // Get the URL from the engine (possibly starting the pvserver)
+ serverUrl = GetService()->FindOrStartPVServer(0); // take the first free port
+ }
+
msg << "connectToExternalPVServer(): Trying to connect to the external PVServer '" << serverUrl << "' ...";
MESSAGE(msg.str());
if (!pqServerConnectReaction::connectToServer(pqServerResource(serverUrl.c_str())))
- {
- std::stringstream msg2;
- msg2 << "Error while connecting to the requested pvserver '" << serverUrl;
- msg2 << "'. Might use default built-in connection instead!" << std::endl;
- qWarning(msg2.str().c_str()); // will go to the ParaView console (see ParavisMessageOutput below)
- SUIT_MessageBox::warning( aDesktop,
- QString("Error connecting to PVServer"), QString(msg2.str().c_str()));
- return false;
- }
+ {
+ std::stringstream msg2;
+ msg2 << "Error while connecting to the requested pvserver '" << serverUrl;
+ msg2 << "'. Might use default built-in connection instead!" << std::endl;
+ qWarning(msg2.str().c_str()); // will go to the ParaView console (see ParavisMessageOutput below)
+ SUIT_MessageBox::warning( desktop,
+ QString("Error connecting to PVServer"), QString(msg2.str().c_str()));
+ return false;
+ }
else
- {
- MESSAGE("connectToExternalPVServer(): Connected!");
- GetService()->SetGUIConnected(true);
- }
+ {
+ MESSAGE("connectToExternalPVServer(): Connected!");
+ GetService()->SetGUIConnected(true);
+ }
return true;
}
-
/*!Enable toolbars if view \a view is ParaView viewer and disable otherwise.
*/
void PVViewer_ViewManager::onWindowActivated(SUIT_ViewWindow* view)
{
if (view)
- {
+ {
PVViewer_ViewWindow* pvWindow = dynamic_cast<PVViewer_ViewWindow*>(view);
- PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desktop);
+ PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance( myDesktop );
guiElements->setToolBarEnabled(pvWindow!=0);
- }
+ }
}
//
// Author: Adrien Bruneton (CEA)
-#ifndef PVViewer_VIEWMANAGER_H
-#define PVViewer_VIEWMANAGER_H
+#ifndef PVVIEWER_VIEWMANAGER_H
+#define PVVIEWER_VIEWMANAGER_H
#include "PVViewer.h"
-#include <SUIT_ViewManager.h>
+#include "SUIT_ViewManager.h"
class SUIT_Desktop;
class SUIT_Study;
class SUIT_ViewWindow;
-class LogWindow;
class PVServer_ServiceWrapper;
class QMainWindow;
Q_OBJECT
public:
- PVViewer_ViewManager( SUIT_Study*, SUIT_Desktop*, LogWindow *);
+ PVViewer_ViewManager(SUIT_Study*, SUIT_Desktop*);
~PVViewer_ViewManager() {}
//! Get the CORBA engine wrapper.
- static PVServer_ServiceWrapper * GetService();
+ static PVServer_ServiceWrapper* GetService();
//! Get PVViewer configuration path as stored by SALOME's resource manager:
static QString GetPVConfigPath();
//! Connect to the external PVServer, using the PARAVIS engine to launch it if it is not
//! already up.
- static bool ConnectToExternalPVServer(QMainWindow* aDesktop);
+ static bool ConnectToExternalPVServer(QMainWindow*);
protected slots:
void onWindowActivated(SUIT_ViewWindow*);
-
-private:
- SUIT_Desktop * desktop;
};
-#endif
+#endif // PVVIEWER_VIEWMANAGER_H
#include "PVViewer_ViewWindow.h"
#include <utilities.h>
-#include <SUIT_Desktop.h>
+#include "SUIT_Desktop.h"
//----------------------------------------
PVViewer_Viewer::PVViewer_Viewer()
Create new instance of view window on desktop \a theDesktop.
\retval SUIT_ViewWindow* - created view window pointer.
*/
-SUIT_ViewWindow* PVViewer_Viewer::createView(SUIT_Desktop* theDesktop)
+SUIT_ViewWindow* PVViewer_Viewer::createView(SUIT_Desktop* desktop)
{
- PVViewer_ViewWindow* aPVView = new PVViewer_ViewWindow(theDesktop, this);
- return aPVView;
+ return new PVViewer_ViewWindow(desktop, this);
}
//
// Author: Adrien Bruneton (CEA)
-#if !defined(_PVViewer_VIEWMODEL_H)
-#define _PVViewer_VIEWMODEL_H
+#ifndef PVVIEWER_VIEWMODEL_H
+#define PVVIEWER_VIEWMODEL_H
#include "PVViewer.h"
-#include <SUIT_ViewModel.h>
+#include "SUIT_ViewModel.h"
class SUIT_ViewWindow;
class SUIT_Desktop;
PVViewer_Viewer();
virtual ~PVViewer_Viewer() {}
- virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+ virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
virtual QString getType() const { return Type(); }
static QString Type() { return "ParaView"; }
};
-#endif // !defined(_PVViewer_VIEWMODEL_H)
-
+#endif // PVVIEWER_VIEWMODEL_H
#include "PVViewer_GUIElements.h"
#include "PVViewer_ViewManager.h"
-#include <SUIT_ViewManager.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_Application.h>
+#include "SUIT_ViewManager.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_Application.h"
#include <pqTabbedMultiViewWidget.h>
#include <pqApplicationCore.h>
{
return myPVMgr;
}
-
-//void PVViewer_ViewWindow::onEmulateApply()
-//{
-// emit this->applyRequest();
-//}
//
// Author : Adrien Bruneton (CEA)
-
-#ifndef PVViewer_VIEWWINDOW_H
-#define PVViewer_VIEWWINDOW_H
+#ifndef PVVIEWER_VIEWWINDOW_H
+#define PVVIEWER_VIEWWINDOW_H
#include "PVViewer.h"
-#include <SUIT_ViewWindow.h>
+#include "SUIT_ViewWindow.h"
#include <QMap>
class SUIT_Desktop;
PVViewer_ViewWindow( SUIT_Desktop*, PVViewer_Viewer* );
virtual ~PVViewer_ViewWindow();
- virtual QString getVisualParameters();
- virtual void setVisualParameters( const QString& );
+ virtual QString getVisualParameters();
+ virtual void setVisualParameters( const QString& );
- pqTabbedMultiViewWidget* getMultiViewManager() const;
+ pqTabbedMultiViewWidget* getMultiViewManager() const;
static void removePVMgr();
private:
- SUIT_Desktop* myDesktop;
- PVViewer_Viewer* myModel;
- pqTabbedMultiViewWidget* myPVMgr;
+ SUIT_Desktop* myDesktop;
+ PVViewer_Viewer* myModel;
+ pqTabbedMultiViewWidget* myPVMgr;
};
-#endif // PLOT2D_VIEWWINDOW_H
+#endif // PVVIEWER_VIEWWINDOW_H
Qtx.h
QtxEvalExpr.h
QtxMap.h
+ QtxMsgHandler.h
QtxPreferenceMgr.h
QtxResourceMgr.h
QtxTranslator.h
QtxMRUAction.cxx
QtxMainWindow.cxx
QtxMenu.cxx
+ QtxMsgHandler.cxx
QtxMultiAction.cxx
QtxNotify.cxx
QtxPagePrefMgr.cxx
--- /dev/null
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "QtxMsgHandler.h"
+
+/*!
+ \brief Custom Qt messages handler.
+
+ To install message handler use qInstallMessageHandler() function:
+
+ \code
+ #include <QtxMsgHandler.h>
+ qInstallMessageHandler(QtxMsgHandler);
+ \code
+
+ To process Qt message implement a callback class by inheriting from
+ QtxMsgHandlerCallback and override its qtMessage() function.
+
+ \sa QtxMsgHandlerCallback
+*/
+void QtxMsgHandler(QtMsgType type, const QMessageLogContext& context, const QString& message)
+{
+ foreach(QtxMsgHandlerCallback* callback, QtxMsgHandlerCallback::callbacks)
+ {
+ callback->qtMessage( type, context, message );
+ }
+}
+
+/*!
+ \class QtxMsgHandlerCallback
+ \brief A callback object to handle Qt messages.
+
+ The QtxMsgHandlerCallback class works in conjunction with QtxMsgHandler()
+ function which is a message handler itself.
+
+ Implement your own callback class by inheriting from QtxMsgHandlerCallback
+ and override its qtMessage() function. Default implementation does nothing.
+
+ \sa QtxMsgHandler()
+*/
+
+QList<QtxMsgHandlerCallback*> QtxMsgHandlerCallback::callbacks;
+
+/*!
+ \brief Create new callback instance and activate it \a on is \c true.
+ \param on Automatically activate callback on creation. Defaults to \c true.
+ \sa activate()
+*/
+QtxMsgHandlerCallback::QtxMsgHandlerCallback(bool on)
+{
+ if ( on )
+ activate();
+}
+
+/*!
+ \brief Deactivate and destroy callback instance.
+ \sa deactivate()
+*/
+QtxMsgHandlerCallback::~QtxMsgHandlerCallback()
+{
+ deactivate();
+}
+
+/*!
+ \brief Activate this callback instance in the message handler.
+ \sa deactivate()
+*/
+void QtxMsgHandlerCallback::activate()
+{
+ if ( !callbacks.contains( this ) )
+ callbacks.push_back( this );
+}
+
+/*!
+ \brief Deactivate this callback instance from the message handler.
+ \sa activate()
+*/
+void QtxMsgHandlerCallback::deactivate()
+{
+ if ( callbacks.contains( this ) )
+ callbacks.removeAll( this );
+}
+
+/*!
+ \brief This function is called when a new Qt message is reported.
+
+ Override this method in your custom callback class to handle Qt
+ messages.
+
+ Default implementation does nothing.
+
+ \param type Qt message type.
+ \param context Message context.
+ \param message Message text.
+*/
+void QtxMsgHandlerCallback::qtMessage(QtMsgType /*type*/,
+ const QMessageLogContext& /*context*/,
+ const QString& /*message*/)
+{
+}
--- /dev/null
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef QTXMSGHANDLER_H
+#define QTXMSGHANDLER_H
+
+#include "Qtx.h"
+#include <QList>
+
+void QTX_EXPORT QtxMsgHandler(QtMsgType, const QMessageLogContext&, const QString&);
+
+class QTX_EXPORT QtxMsgHandlerCallback
+{
+ friend void QtxMsgHandler(QtMsgType, const QMessageLogContext&, const QString&);
+
+public:
+ QtxMsgHandlerCallback(bool = true);
+ virtual ~QtxMsgHandlerCallback();
+
+protected:
+ virtual void qtMessage(QtMsgType, const QMessageLogContext&, const QString&);
+
+ void activate();
+ void deactivate();
+
+private:
+ static QList<QtxMsgHandlerCallback*> callbacks;
+};
+
+#endif // QTXMSGHANDLER_H
#include "Session_Session_i.hxx"
#include <Qtx.h>
+#include <QtxMsgHandler.h>
#include <QtxSplash.h>
#ifdef USE_SALOME_STYLE
* - stop Session ( must be idle )
* - get session state
*/
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-void MessageOutput( QtMsgType type, const char* msg )
-#else
-void MessageOutput( QtMsgType type, const QMessageLogContext &context, const QString &msg )
-#endif
+
+class SessionMsgHandler: public QtxMsgHandlerCallback
{
- switch ( type )
+public:
+ SessionMsgHandler() {}
+ void qtMessage(QtMsgType type, const QMessageLogContext& context, const QString& message)
{
- case QtDebugMsg:
+ switch ( type )
+ {
+ case QtDebugMsg:
#ifdef QT_DEBUG_MESSAGE
- MESSAGE( "Debug: " << qPrintable( QString(msg) ) );
+ MESSAGE( "Debug: " << qPrintable( message ) );
#endif
- break;
- case QtWarningMsg:
- MESSAGE( "Warning: " << qPrintable( QString(msg) ) );
- break;
- case QtFatalMsg:
- MESSAGE( "Fatal: " << qPrintable( QString(msg) ) );
- break;
+ break;
+ case QtWarningMsg:
+ MESSAGE( "Warning: " << qPrintable( message ) );
+ break;
+ case QtCriticalMsg:
+ MESSAGE( "Critical: " << qPrintable( message ) );
+ break;
+ case QtFatalMsg:
+ MESSAGE( "Fatal: " << qPrintable( message ) );
+ break;
+ case QtInfoMsg:
+ default:
+ MESSAGE( "Information: " << qPrintable( message ) );
+ break;
+ }
}
-}
+};
QString salomeVersion()
{
int main( int argc, char **argv )
{
// Install Qt debug messages handler
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- qInstallMsgHandler( MessageOutput );
-#else
- qInstallMessageHandler( MessageOutput );
-#endif
+ SessionMsgHandler msgHandler;
+ qInstallMessageHandler(QtxMsgHandler);
// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)