From bf1b39a1669dc4f0d23f880a5287aafb169c4364 Mon Sep 17 00:00:00 2001 From: imn Date: Thu, 26 Nov 2015 17:47:18 +0300 Subject: [PATCH] Migrate to Qt 5 --- CMakeLists.txt | 10 +++++++--- src/genericgui/BL_Buttons.cxx | 4 ++++ src/genericgui/BL_Buttons.hxx | 2 ++ src/genericgui/BL_CreateJobWizard.cxx | 3 +++ src/genericgui/BL_CreateJobWizard.hxx | 3 +++ src/genericgui/BL_GenericGui.cxx | 5 +++++ src/genericgui/BL_JobTab.cxx | 2 ++ src/genericgui/BL_JobTab.hxx | 1 + src/genericgui/BL_JobsManager_QT.cxx | 10 ++++++++-- src/genericgui/BL_JobsManager_QT.hxx | 2 ++ src/genericgui/BL_JobsTable.cxx | 6 ++++++ src/genericgui/BL_JobsTable.hxx | 1 + src/genericgui/BL_Summary.cxx | 2 ++ src/genericgui/CMakeLists.txt | 6 +++--- src/genericgui/JM_EditSalomeResource.cxx | 8 ++++++++ src/genericgui/JM_EditSalomeResource.hxx | 9 +++++++++ src/genericgui/JM_ResourceCatalog.cxx | 3 +++ src/genericgui/JM_ResourceCatalog.hxx | 2 ++ src/genericgui/JM_SalomeResource.cxx | 5 +++++ src/genericgui/JM_SalomeResource.hxx | 5 +++++ src/salomegui/CMakeLists.txt | 4 +++- src/standalone/main.cxx | 2 ++ src/wrappers/BL_MainWindows_Qt.cxx | 4 ++++ src/wrappers/BL_MainWindows_SALOME.cxx | 2 ++ src/wrappers/BL_MainWindows_Wrap.hxx | 1 + 25 files changed, 93 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3316b89..89d8ead 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,9 +94,13 @@ 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) + INCLUDE(${QT_USE_FILE}) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() # Detection summary: SALOME_PACKAGE_REPORT_AND_CHECK() diff --git a/src/genericgui/BL_Buttons.cxx b/src/genericgui/BL_Buttons.cxx index 39218c3..9a58144 100644 --- a/src/genericgui/BL_Buttons.cxx +++ b/src/genericgui/BL_Buttons.cxx @@ -17,6 +17,10 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include +#include + #include "BL_Buttons.hxx" BL::Buttons::Buttons(QWidget * parent) : QWidget(parent) diff --git a/src/genericgui/BL_Buttons.hxx b/src/genericgui/BL_Buttons.hxx index 6329422..83cf453 100644 --- a/src/genericgui/BL_Buttons.hxx +++ b/src/genericgui/BL_Buttons.hxx @@ -21,6 +21,8 @@ #define _BL_BUTTONS_HXX_ #include +#include +#include #include "BL_Traces.hxx" diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 0367950..6c7ddd6 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -17,6 +17,9 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include + #include "BL_CreateJobWizard.hxx" #include "BL_JobsManager_QT.hxx" #ifndef WNT diff --git a/src/genericgui/BL_CreateJobWizard.hxx b/src/genericgui/BL_CreateJobWizard.hxx index ee6a34a..8e31953 100644 --- a/src/genericgui/BL_CreateJobWizard.hxx +++ b/src/genericgui/BL_CreateJobWizard.hxx @@ -21,6 +21,9 @@ #define _BL_CREATEJOBWIZARD_HXX_ #include +#include +#include +#include #include "BL_Traces.hxx" #include "BL_SALOMEServices.hxx" diff --git a/src/genericgui/BL_GenericGui.cxx b/src/genericgui/BL_GenericGui.cxx index 2f773be..a0bc816 100644 --- a/src/genericgui/BL_GenericGui.cxx +++ b/src/genericgui/BL_GenericGui.cxx @@ -17,6 +17,11 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include +#include +#include + #include "BL_GenericGui.hxx" #ifdef WNT diff --git a/src/genericgui/BL_JobTab.cxx b/src/genericgui/BL_JobTab.cxx index c92f5c9..981d99b 100644 --- a/src/genericgui/BL_JobTab.cxx +++ b/src/genericgui/BL_JobTab.cxx @@ -17,6 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include + #include "BL_JobTab.hxx" #include "BL_Traces.hxx" diff --git a/src/genericgui/BL_JobTab.hxx b/src/genericgui/BL_JobTab.hxx index 46e8a81..2ed75a9 100644 --- a/src/genericgui/BL_JobTab.hxx +++ b/src/genericgui/BL_JobTab.hxx @@ -21,6 +21,7 @@ #define _BL_JOBTAB_HXX_ #include +#include #include "BL_JobsManager_QT.hxx" diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index d2f3e01..888c6aa 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -17,6 +17,12 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include +#include +#include +#include + #include "BL_JobsManager_QT.hxx" #include "BL_GenericGui.hxx" #include @@ -132,8 +138,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..956815c 100644 --- a/src/genericgui/BL_JobsManager_QT.hxx +++ b/src/genericgui/BL_JobsManager_QT.hxx @@ -21,6 +21,8 @@ #define _BL_JOBSMANAGER_QT_HXX_ #include +#include +#include #include "BL_Traces.hxx" #include "BL_JobsManager.hxx" diff --git a/src/genericgui/BL_JobsTable.cxx b/src/genericgui/BL_JobsTable.cxx index 1579a39..303f512 100644 --- a/src/genericgui/BL_JobsTable.cxx +++ b/src/genericgui/BL_JobsTable.cxx @@ -17,6 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include + #include "BL_JobsTable.hxx" #include "BL_Traces.hxx" #include "BL_GenericGui.hxx" @@ -39,7 +41,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..7e6cad7 100644 --- a/src/genericgui/BL_JobsTable.hxx +++ b/src/genericgui/BL_JobsTable.hxx @@ -21,6 +21,7 @@ #define _BL_JOBSTABLE_HXX_ #include +#include namespace BL { diff --git a/src/genericgui/BL_Summary.cxx b/src/genericgui/BL_Summary.cxx index cc87af3..6c7dfea 100644 --- a/src/genericgui/BL_Summary.cxx +++ b/src/genericgui/BL_Summary.cxx @@ -17,6 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include + #include "BL_Summary.hxx" #include "BL_Traces.hxx" 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.cxx b/src/genericgui/JM_EditSalomeResource.cxx index edc568e..2c912d2 100644 --- a/src/genericgui/JM_EditSalomeResource.cxx +++ b/src/genericgui/JM_EditSalomeResource.cxx @@ -17,6 +17,14 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include +#include +#include +#include +#include +#include + #include "JM_EditSalomeResource.hxx" #include "BL_Traces.hxx" diff --git a/src/genericgui/JM_EditSalomeResource.hxx b/src/genericgui/JM_EditSalomeResource.hxx index f80b51d..4256ce8 100644 --- a/src/genericgui/JM_EditSalomeResource.hxx +++ b/src/genericgui/JM_EditSalomeResource.hxx @@ -22,6 +22,15 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include + #include "BL_SALOMEServices.hxx" namespace JM diff --git a/src/genericgui/JM_ResourceCatalog.cxx b/src/genericgui/JM_ResourceCatalog.cxx index 4d2ded9..8190744 100644 --- a/src/genericgui/JM_ResourceCatalog.cxx +++ b/src/genericgui/JM_ResourceCatalog.cxx @@ -17,6 +17,9 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include + #include "JM_ResourceCatalog.hxx" #include "BL_Traces.hxx" #include "JM_SalomeResource.hxx" diff --git a/src/genericgui/JM_ResourceCatalog.hxx b/src/genericgui/JM_ResourceCatalog.hxx index 9acce25..d32c37d 100644 --- a/src/genericgui/JM_ResourceCatalog.hxx +++ b/src/genericgui/JM_ResourceCatalog.hxx @@ -21,6 +21,8 @@ #define _JM_RESOURCECATALOG_HXX_ #include +#include +#include #include "BL_SALOMEServices.hxx" diff --git a/src/genericgui/JM_SalomeResource.cxx b/src/genericgui/JM_SalomeResource.cxx index 43398b9..1e5a59b 100644 --- a/src/genericgui/JM_SalomeResource.cxx +++ b/src/genericgui/JM_SalomeResource.cxx @@ -17,6 +17,11 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include +#include +#include + #include "JM_SalomeResource.hxx" #include "BL_Traces.hxx" diff --git a/src/genericgui/JM_SalomeResource.hxx b/src/genericgui/JM_SalomeResource.hxx index 62f26d3..df53fa4 100644 --- a/src/genericgui/JM_SalomeResource.hxx +++ b/src/genericgui/JM_SalomeResource.hxx @@ -21,6 +21,11 @@ #define _JM_SALOMERESOURCE_HXX_ #include +#include +#include +#include +#include + #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..3d9ed56 100644 --- a/src/standalone/main.cxx +++ b/src/standalone/main.cxx @@ -18,6 +18,8 @@ // #include +#include + #include "BL_GenericGui.hxx" #include "BL_MainWindows_Qt.hxx" diff --git a/src/wrappers/BL_MainWindows_Qt.cxx b/src/wrappers/BL_MainWindows_Qt.cxx index 86a0403..9c41b3a 100644 --- a/src/wrappers/BL_MainWindows_Qt.cxx +++ b/src/wrappers/BL_MainWindows_Qt.cxx @@ -17,6 +17,10 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include +#include +#include + #include "BL_MainWindows_Qt.hxx" BL::MainWindows_Qt::MainWindows_Qt(QMainWindow * main_window) diff --git a/src/wrappers/BL_MainWindows_SALOME.cxx b/src/wrappers/BL_MainWindows_SALOME.cxx index 2486601..06f1c77 100644 --- a/src/wrappers/BL_MainWindows_SALOME.cxx +++ b/src/wrappers/BL_MainWindows_SALOME.cxx @@ -17,6 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include + #include "BL_MainWindows_SALOME.hxx" #include diff --git a/src/wrappers/BL_MainWindows_Wrap.hxx b/src/wrappers/BL_MainWindows_Wrap.hxx index f00efd2..7cdfe1f 100644 --- a/src/wrappers/BL_MainWindows_Wrap.hxx +++ b/src/wrappers/BL_MainWindows_Wrap.hxx @@ -22,6 +22,7 @@ #define _BL_MAINWINDOWS_WRAP_HXX_ #include +#include #include "BL_Traces.hxx" namespace BL -- 2.39.2