From: imn Date: Thu, 26 Nov 2015 14:47:18 +0000 (+0300) Subject: Merge Qt5 porting. X-Git-Tag: V8_0_0a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bc2afa536fd26e2d1612e2c626fa6b60f7166a63;p=modules%2Fjobmanager.git Merge Qt5 porting. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3316b89..d340b4c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,9 +94,12 @@ ELSE(EXISTS ${GUI_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR") ENDIF(EXISTS ${GUI_ROOT_DIR}) -# Qt4 -FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml) -INCLUDE(${QT_USE_FILE}) +# Qt +IF(NOT SALOME_GUI_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() # Detection summary: SALOME_PACKAGE_REPORT_AND_CHECK() diff --git a/src/genericgui/BL_Buttons.hxx b/src/genericgui/BL_Buttons.hxx index 6329422..815214f 100644 --- a/src/genericgui/BL_Buttons.hxx +++ b/src/genericgui/BL_Buttons.hxx @@ -20,7 +20,11 @@ #ifndef _BL_BUTTONS_HXX_ #define _BL_BUTTONS_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif #include "BL_Traces.hxx" diff --git a/src/genericgui/BL_CreateJobWizard.hxx b/src/genericgui/BL_CreateJobWizard.hxx index ee6a34a..39d2ea0 100644 --- a/src/genericgui/BL_CreateJobWizard.hxx +++ b/src/genericgui/BL_CreateJobWizard.hxx @@ -20,7 +20,11 @@ #ifndef _BL_CREATEJOBWIZARD_HXX_ #define _BL_CREATEJOBWIZARD_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif #include "BL_Traces.hxx" #include "BL_SALOMEServices.hxx" diff --git a/src/genericgui/BL_GenericGui.hxx b/src/genericgui/BL_GenericGui.hxx index 5130302..2e78812 100644 --- a/src/genericgui/BL_GenericGui.hxx +++ b/src/genericgui/BL_GenericGui.hxx @@ -20,7 +20,11 @@ #ifndef _BL_GENERICGUI_HXX_ #define _BL_GENERICGUI_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif #include "BL_GenericGuiDefines.hxx" diff --git a/src/genericgui/BL_JobTab.hxx b/src/genericgui/BL_JobTab.hxx index 46e8a81..89e86cb 100644 --- a/src/genericgui/BL_JobTab.hxx +++ b/src/genericgui/BL_JobTab.hxx @@ -20,7 +20,11 @@ #ifndef _BL_JOBTAB_HXX_ #define _BL_JOBTAB_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif #include "BL_JobsManager_QT.hxx" diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index d2f3e01..cb8d7dd 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -132,8 +132,8 @@ BL::JobsManager_QT::save_jobs_button() filters << "XML files (*.xml)" << "Any files (*)"; dialog.setFileMode(QFileDialog::AnyFile); - dialog.setFilters(filters); - dialog.selectFilter("(*.xml)"); + dialog.setNameFilters(filters); + dialog.selectNameFilter("(*.xml)"); dialog.setDefaultSuffix("xml"); dialog.setConfirmOverwrite(true); dialog.setAcceptMode(QFileDialog::AcceptSave); diff --git a/src/genericgui/BL_JobsManager_QT.hxx b/src/genericgui/BL_JobsManager_QT.hxx index c2155ca..88fb54f 100644 --- a/src/genericgui/BL_JobsManager_QT.hxx +++ b/src/genericgui/BL_JobsManager_QT.hxx @@ -20,7 +20,11 @@ #ifndef _BL_JOBSMANAGER_QT_HXX_ #define _BL_JOBSMANAGER_QT_HXX_ -#include +#include +#include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif #include "BL_Traces.hxx" #include "BL_JobsManager.hxx" diff --git a/src/genericgui/BL_JobsTable.cxx b/src/genericgui/BL_JobsTable.cxx index 1579a39..e8f4391 100644 --- a/src/genericgui/BL_JobsTable.cxx +++ b/src/genericgui/BL_JobsTable.cxx @@ -39,7 +39,11 @@ BL::JobsTable::JobsTable(QWidget *parent) : QTableView(parent) setSelectionMode(QAbstractItemView::ExtendedSelection); QHeaderView * header_view = verticalHeader(); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) header_view->setClickable(false); +#else + header_view->setSectionsClickable(false); +#endif } BL::JobsTable::~JobsTable() diff --git a/src/genericgui/BL_JobsTable.hxx b/src/genericgui/BL_JobsTable.hxx index 23875e2..a30c202 100644 --- a/src/genericgui/BL_JobsTable.hxx +++ b/src/genericgui/BL_JobsTable.hxx @@ -20,7 +20,11 @@ #ifndef _BL_JOBSTABLE_HXX_ #define _BL_JOBSTABLE_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif namespace BL { diff --git a/src/genericgui/BL_Summary.hxx b/src/genericgui/BL_Summary.hxx index 1128508..f16bc74 100644 --- a/src/genericgui/BL_Summary.hxx +++ b/src/genericgui/BL_Summary.hxx @@ -20,7 +20,12 @@ #ifndef _BL_SUMMARY_HXX_ #define _BL_SUMMARY_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif + #include "BL_JobsManager_QT.hxx" namespace BL diff --git a/src/genericgui/CMakeLists.txt b/src/genericgui/CMakeLists.txt index 1472154..ce8e140 100644 --- a/src/genericgui/CMakeLists.txt +++ b/src/genericgui/CMakeLists.txt @@ -17,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(UseQt4Ext) +INCLUDE(UseQtExt) # --- options --- # additional include directories @@ -65,7 +65,7 @@ SET(BL_GenericGui_HEADERS # --- sources --- # sources / moc wrappings -QT4_WRAP_CPP(_moc_SOURCES ${BL_GenericGui_HEADERS}) +QT_WRAP_MOC(_moc_SOURCES ${BL_GenericGui_HEADERS}) # sources / static SET(_other_SOURCES @@ -92,7 +92,7 @@ SET(_uic_files ) # header files / uic wrappings -QT4_WRAP_UI(_uic_HEADERS ${_uic_files}) +QT_WRAP_UIC(_uic_HEADERS ${_uic_files}) # sources / to compile SET(BL_GenericGui_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS}) diff --git a/src/genericgui/JM_EditSalomeResource.hxx b/src/genericgui/JM_EditSalomeResource.hxx index f80b51d..b95afe5 100644 --- a/src/genericgui/JM_EditSalomeResource.hxx +++ b/src/genericgui/JM_EditSalomeResource.hxx @@ -20,8 +20,14 @@ #ifndef _JM_EDITSALOMERESOURCE_HXX_ #define _JM_EDITSALOMERESOURCE_HXX_ -#include +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif + +#include + #include "BL_SALOMEServices.hxx" namespace JM diff --git a/src/genericgui/JM_ResourceCatalog.hxx b/src/genericgui/JM_ResourceCatalog.hxx index 9acce25..078afbb 100644 --- a/src/genericgui/JM_ResourceCatalog.hxx +++ b/src/genericgui/JM_ResourceCatalog.hxx @@ -20,7 +20,11 @@ #ifndef _JM_RESOURCECATALOG_HXX_ #define _JM_RESOURCECATALOG_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif #include "BL_SALOMEServices.hxx" diff --git a/src/genericgui/JM_SalomeResource.hxx b/src/genericgui/JM_SalomeResource.hxx index 62f26d3..fbd95f9 100644 --- a/src/genericgui/JM_SalomeResource.hxx +++ b/src/genericgui/JM_SalomeResource.hxx @@ -20,7 +20,12 @@ #ifndef _JM_SALOMERESOURCE_HXX_ #define _JM_SALOMERESOURCE_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif + #include "BL_SALOMEServices.hxx" #include diff --git a/src/salomegui/CMakeLists.txt b/src/salomegui/CMakeLists.txt index a3bf912..1f656c2 100644 --- a/src/salomegui/CMakeLists.txt +++ b/src/salomegui/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQtExt) + # --- options --- # additional include directories INCLUDE_DIRECTORIES( @@ -58,7 +60,7 @@ SET(JOBMANAGER_HEADERS # --- sources --- # sources / moc wrappings -QT4_WRAP_CPP(_moc_SOURCES ${JOBMANAGER_HEADERS}) +QT_WRAP_MOC(_moc_SOURCES ${JOBMANAGER_HEADERS}) # sources / static SET(_other_SOURCES diff --git a/src/standalone/main.cxx b/src/standalone/main.cxx index 94960f5..cef72e3 100644 --- a/src/standalone/main.cxx +++ b/src/standalone/main.cxx @@ -17,7 +17,12 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif + #include "BL_GenericGui.hxx" #include "BL_MainWindows_Qt.hxx" diff --git a/src/wrappers/BL_MainWindows_Wrap.hxx b/src/wrappers/BL_MainWindows_Wrap.hxx index f00efd2..74ce42a 100644 --- a/src/wrappers/BL_MainWindows_Wrap.hxx +++ b/src/wrappers/BL_MainWindows_Wrap.hxx @@ -21,7 +21,12 @@ #ifndef _BL_MAINWINDOWS_WRAP_HXX_ #define _BL_MAINWINDOWS_WRAP_HXX_ +#include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include +#endif + #include "BL_Traces.hxx" namespace BL