##
## From GUI: part 1 (Qt must be checked before ParaView)
##
-FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtHelp)
-# This search for qhelpgenerator is required here
-# to avoid detecting native one due to bug in ParaViewMacros.cmake
-FIND_PROGRAM(QT_HELP_GENERATOR
- qhelpgenerator
- PATHS "${QT_BINARY_DIR}"
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- DOC "qhelpgenerator used to compile Qt help project files")
-MARK_AS_ADVANCED(QT_HELP_GENERATOR)
+IF (NOT SALOME_GUI_BUILD_WITH_QT5)
+ FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtHelp)
+ # This search for qhelpgenerator is required here
+ # to avoid detecting native one due to bug in ParaViewMacros.cmake
+ FIND_PROGRAM(QT_HELP_GENERATOR
+ qhelpgenerator
+ PATHS "${QT_BINARY_DIR}"
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
+ DOC "qhelpgenerator used to compile Qt help project files")
+ MARK_AS_ADVANCED(QT_HELP_GENERATOR)
+ELSE()
+ FIND_PACKAGE(SalomeQt5 REQUIRED)
+ENDIF()
##
## Specific to ParaViS:
##
FIND_PACKAGE(SalomeParaView REQUIRED)
+
# GUI itself has to be loaded AFTER ParaView: the ParaView config doesn't mix
# well with the VTK one (and GUI loads VTK):
FIND_PACKAGE(SalomeGUI REQUIRED)
##
## From SMESH
##
+
IF(SALOME_PARAVIS_BUILD_PLUGINS AND SALOME_PARAVIS_USE_SMESH_SOURCE)
IF(NOT SALOME_PARAVIS_USE_GEOM_SOURCE)
SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the Salome GEOM")
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
# --- options ---
resources/pqCustomSettingsWidget.ui
)
-QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files})
+QT_WRAP_UIC(_ui_FORMS_HEADERS ${_ui_files})
# header files / to be processed by moc
SET(_moc_HEADERS
# --- sources ---
# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+QT_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
# sources / static
SET(_other_SOURCES
# --- header and resources installation ---
INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})
// 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 );
typedef QMap<int, bool> DockWindowMap;
DockWindowMap myCommonMap;
-
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QtMsgHandler myOldMsgHandler;
-
+#else
+ QtMessageHandler myOldMsgHandler;
+#endif
vtkEventQtSlotConnect* VTKConnect;
pqPythonScriptEditor* myTraceWindow;
cmake_minimum_required(VERSION 2.8)
+INCLUDE(UseQtExt)
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})
SET (outifaces)
SET (outsrcs)
-QT4_WRAP_CPP(moc_srcs pqArraysEditorPropertyWidget.h pqEditComponents.h)
+QT_WRAP_MOC(moc_srcs pqArraysEditorPropertyWidget.h pqEditComponents.h)
ADD_PARAVIEW_PROPERTY_GROUP_WIDGET(outifaces outsrcs
TYPE "custom_arrays_editor"
QTableView* componentsTable = new QTableView( this );
componentsTable->setModel( model );
aCompsLayout->addWidget( componentsTable );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
componentsTable->horizontalHeader()->setResizeMode( pqComponentsModel::COMPONENT_NAME, QHeaderView::Stretch );
componentsTable->horizontalHeader()->setResizeMode( pqComponentsModel::NEW_COMPONENT_NAME, QHeaderView::Stretch );
-
+#else
+ componentsTable->horizontalHeader()->setSectionResizeMode( pqComponentsModel::COMPONENT_NAME, QHeaderView::Stretch );
+ componentsTable->horizontalHeader()->setSectionResizeMode( pqComponentsModel::NEW_COMPONENT_NAME, QHeaderView::Stretch );
+#endif
/// Parameters
QVBoxLayout *aParamsLayout = new QVBoxLayout( aParams );
myRenameAllComps = new QCheckBox( "Rename all similar Components", aParams );
// Layout
QVBoxLayout* lay = new QVBoxLayout(this);
lay->addWidget(myArraysTable);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::PROCESSING, QHeaderView::ResizeToContents );
myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::NAME, QHeaderView::Stretch);
myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::NEW_NAME, QHeaderView::Stretch );
myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::COMPONENTS, QHeaderView::ResizeToContents );
+#else
+ myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::PROCESSING, QHeaderView::ResizeToContents );
+ myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::NAME, QHeaderView::Stretch);
+ myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::NEW_NAME, QHeaderView::Stretch );
+ myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::COMPONENTS, QHeaderView::ResizeToContents );
+#endif
myArraysTable->resizeColumnsToContents();
// Connections
IF(PARAVIEW_BUILD_QT_GUI)
- QT4_WRAP_UI(CLIENT_UI_SRCS
+ QT_WRAP_UIC(CLIENT_UI_SRCS
Resources/UI/MEDReaderVectorsWidget.ui
Resources/UI/MEDReaderTimeModeWidget.ui)
pqMEDReaderTimesFlagsWidget.cxx
pqMEDReaderFieldsWidget.cxx)
- QT4_WRAP_CPP(MOC_SRCS
+ QT_WRAP_MOC(MOC_SRCS
pqExtractGroupFieldsWidget.h
pqAbstractFieldsWidget.h
VectBoolSpreadSheet.h
this->verticalHeader()->setMinimumSectionSize(2);
this->verticalHeader()->setDefaultSectionSize(2);
this->setItemDelegate(_delegate);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
this->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
this->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
+#else
+ this->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ this->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+#endif
this->resizeColumnsToContents();
this->resizeRowsToContents();
//this->verticalHeader()->hide();
IF(PARAVIEW_BUILD_QT_GUI)
+ INCLUDE(UseQtExt)
# Custom object panel for the reader and
# custom display panel for line chart view
- QT4_WRAP_UI(CLIENT_UI_SRCS
+ QT_WRAP_UIC(CLIENT_UI_SRCS
Resources/UI/TableReaderPanel.ui
Resources/UI/CustomXYChartDisplayPanel.ui
)
- QT4_WRAP_CPP(MOC_SRCS
+ QT_WRAP_MOC(MOC_SRCS
pqTableReaderPanel.h
pqTableTo3DPanel.h
pqCustomChartDisplayPanelImplementation.h
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQtExt)
+
# create a plugin with a custom view that shows up in ParaView's multi-view
# manager. this plugin also contains a custom display panel
# moc the Qt based .h files
-QT4_WRAP_CPP(MOC_SRCS MyView.h MyDisplay.h MyViewActiveOptions.h MyViewOptions.h)
+QT_WRAP_MOC(MOC_SRCS MyView.h MyDisplay.h MyViewActiveOptions.h MyViewOptions.h)
# invoke macro to create sources for our custom view and display panel
ADD_PARAVIEW_VIEW_MODULE(
OPTION(LIGHTPARAVIS_WITH_GUI "Build GUI test app" ON)
# Package detection
-FIND_PACKAGE(Qt4 REQUIRED)
+IF (NOT SALOME_GUI_BUILD_WITH_QT5)
+ FIND_PACKAGE(Qt4 REQUIRED)
+ELSE()
+ FIND_PACKAGE(Qt5Core)
+ FIND_PACKAGE(Qt5Gui)
+ENDIF()
LIST(APPEND CMAKE_PREFIX_PATH "$ENV{PARAVIEW_ROOT_DIR}")
FIND_PACKAGE(ParaView REQUIRED)
#
# Author: Adrien Bruneton (CEA)
+INCLUDE(UseQtExt)
+
SET(pl_HEADERS
PLMainWindow.hxx
PLViewTab.hxx
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PARAVIEW_INCLUDE_DIRS})
-INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
# Generate resources that will embedded
"/LightPara/Configuration"
"${PROJECT_SOURCE_DIR}/gui/xml/ParaViewReaders.xml")
-QT4_ADD_RESOURCES(rcs_sources
+QT_ADD_RESOURCES(rcs_sources
${ui_resources}
)
-QT4_WRAP_UI(pl_FORMS_HEADERS ${pl_FORMS})
-QT4_WRAP_CPP(pl_HEADERS_MOC ${pl_HEADERS})
+QT_WRAP_UIC(pl_FORMS_HEADERS ${pl_FORMS})
+QT_WRAP_MOC(pl_HEADERS_MOC ${pl_HEADERS})
ADD_EXECUTABLE(paraLight
${pl_SOURCES}