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

index 5537776c5ca225c43ebc180081e1f714077caf65..b9f363f3cc3f73bbf9d78b9a032dcfc34f957728 100755 (executable)
@@ -104,8 +104,12 @@ ENDIF(SALOME_BUILD_GUI)
 ##
 
 IF(SALOME_BUILD_GUI)
-  # 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()
 ENDIF(SALOME_BUILD_GUI)
 
 # OCCT
index 8bc3e594cde0ecb6591a1f54b418435af847e472..492f7a0af3a38645a23007a6d37f29d83d064dbd 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
@@ -77,7 +77,7 @@ SET(NETGENPluginGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
@@ -107,4 +107,4 @@ INSTALL(TARGETS NETGENPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${
 
 INSTALL(FILES ${NETGENPluginGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_NETGENPLUGIN_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_NETGENPLUGIN_INSTALL_RES_DATA}")
index cf9853c4e6b15de79b15c6f8994c82ff136e2256..14bef04db256226a93d83bf8f38fe57d9dbbc542 100644 (file)
@@ -246,7 +246,11 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
     localSizeHeaders << tr( "LSZ_ENTRY_COLUMN" )<< tr( "LSZ_NAME_COLUMN" ) << tr( "LSZ_LOCALSIZE_COLUMN" );
     myLocalSizeTable->setHorizontalHeaderLabels(localSizeHeaders);
     myLocalSizeTable->horizontalHeader()->hideSection(LSZ_ENTRY_COLUMN);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     myLocalSizeTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
+#else
+    myLocalSizeTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
+#endif
     myLocalSizeTable->resizeColumnToContents(LSZ_NAME_COLUMN);
     myLocalSizeTable->resizeColumnToContents(LSZ_LOCALSIZE_COLUMN);
     myLocalSizeTable->setAlternatingRowColors(true);