]> SALOME platform Git repositories - plugins/hexablockplugin.git/commitdiff
Salome HOME
Migrate to Qt 5 imn/porting_qt5
authorimn <imn@opencascade.com>
Thu, 26 Nov 2015 14:44:29 +0000 (17:44 +0300)
committerimn <imn@opencascade.com>
Thu, 26 Nov 2015 14:44:29 +0000 (17:44 +0300)
CMakeLists.txt
src/GUI/CMakeLists.txt
src/GUI/HEXABLOCKPluginGUI_HypothesisCreator.cxx

index 73764ba742b1d363774f5e2ee05f90207af24fd6..a308129f3b98c8510535124eacd0a25c3d43c984 100755 (executable)
@@ -88,8 +88,12 @@ IF(SALOME_BUILD_GUI)
     LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
     FIND_PACKAGE(SalomeGUI)
     SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
-    # Qt4
-    FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
+    # Qt 
+    IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+      FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
+    ELSE()
+      FIND_PACKAGE(SalomeQt5 REQUIRED)
+    ENDIF()
   ELSE(EXISTS ${GUI_ROOT_DIR})
     MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
   ENDIF(EXISTS ${GUI_ROOT_DIR})
index fff83916b9bef3649ae515198f70237992a99a43..9c7d0ecaa9d7168c48eb67547be8f2eaa9fc0e9a 100644 (file)
@@ -17,7 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # --- options ---
 # additional include directories
@@ -64,7 +64,7 @@ SET(HEXABLOCKPluginGUI_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${HEXABLOCKPluginGUI_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${HEXABLOCKPluginGUI_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
@@ -89,4 +89,4 @@ ADD_LIBRARY(HEXABLOCKPluginGUI ${HEXABLOCKPluginGUI_SOURCES})
 TARGET_LINK_LIBRARIES(HEXABLOCKPluginGUI ${_link_LIBRARIES} )
 INSTALL(TARGETS HEXABLOCKPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_HEXABLOCKPLUGIN_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_HEXABLOCKPLUGIN_INSTALL_RES_DATA}")
index 73f74f16c1ec323427e1295c51a924897946f921..c73f097798665aee8a400c44f8f48a6c29d57a86 100755 (executable)
@@ -309,8 +309,11 @@ QFrame* HEXABLOCKPluginGUI_HypothesisCreator::buildFrame()
   mySmpModel->setHorizontalHeaderLabels(enforcedHeaders);
   myEnforcedTableView->setAlternatingRowColors(true);
   myEnforcedTableView->verticalHeader()->hide();
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   myEnforcedTableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
-  
+#else
+  myEnforcedTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
+#endif
   QLabel* myXCoordLabel = new QLabel( tr( "HEXABLOCK_ENF_VER_X_LABEL" ), myEnfGroup );
   anSmpLayout->addWidget(myXCoordLabel, ENF_VER_X_COORD, 1, 1, 1);
   myXCoord = new QLineEdit(myEnfGroup);