]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Merge Qt5 porting. V8_0_0a1
authorimn <imn@opencascade.com>
Thu, 26 Nov 2015 14:42:23 +0000 (17:42 +0300)
committerrnv <rnv@opencascade.com>
Wed, 23 Dec 2015 13:25:24 +0000 (16:25 +0300)
CMakeLists.txt
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_StdWidget.cxx
src/GUI/CMakeLists.txt

index 2d67ca19bf69fb3133eefd21bac32d526a926ae6..cc7d6d78688ba0dca53b9ad94a6b5f610e41c02a 100755 (executable)
@@ -105,8 +105,12 @@ ENDIF(SALOME_BUILD_GUI)
 ## From 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 dfe5bc0e1a93953927d4349cf4d86edf93a1d62b..5005e1098e01141f355c7af6dbc2ec5962ec897f 100644 (file)
@@ -845,7 +845,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   myEnforcedTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
   myEnforcedTreeWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
   for (int column = 0; column < ENF_VER_NB_COLUMNS; ++column) {
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     myEnforcedTreeWidget->header()->setResizeMode(column,QHeaderView::Interactive);
+#else
+    myEnforcedTreeWidget->header()->setSectionResizeMode(column,QHeaderView::Interactive);
+#endif
     myEnforcedTreeWidget->resizeColumnToContents(column);
   }
   myEnforcedTreeWidget->hideColumn(ENF_VER_FACE_ENTRY_COLUMN);
@@ -962,7 +966,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   
   int periodicityVisibleColumns = 2;
   for (size_t column = 0; column < periodicityVisibleColumns; ++column) {
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
       myPeriodicityTreeWidget->header()->setResizeMode(column,QHeaderView::Interactive);
+#else
+      myPeriodicityTreeWidget->header()->setSectionResizeMode(column,QHeaderView::Interactive);
+#endif
       myPeriodicityTreeWidget->resizeColumnToContents(column);
   }
   myPeriodicityTreeWidget->header()->setStretchLastSection(true);
index 6dff729b2d2219b49077b3844d908b92e04f9234..d4fbc767419a4400f519c2be503c4dcf598f57c1 100644 (file)
@@ -113,17 +113,17 @@ void BLSURFPluginGUI_StdWidget::resizeWidgets() {
   myMinSize->setMinimumWidth( max_width+50 );
   myMaxSize->setMinimumWidth( max_width+50 );
    // Geometrical parameters
-  metrics1 = myAngleMesh->font();
-  metrics2 = myChordalError->font();
+  metrics1 = QFontMetrics(myAngleMesh->font());
+  metrics2 = QFontMetrics(myChordalError->font());
   width1 = metrics1.width(myAngleMesh->GetString());
   width2 = metrics2.width(myChordalError->GetString());
   max_width = max(width1,width2); 
   myAngleMesh->setMinimumWidth( max_width+50 );
   myChordalError->setMinimumWidth( max_width+50 );
   // Other parameters
-  metrics1 = myAnisotropicRatio->font();
-  metrics2 = myTinyEdgeLength->font();
-  metrics3 = myBadElementAspectRatio->font();
+  metrics1 = QFontMetrics(myAnisotropicRatio->font());
+  metrics2 = QFontMetrics(myTinyEdgeLength->font());
+  metrics3 = QFontMetrics(myBadElementAspectRatio->font());
   width1 = metrics1.width(myAnisotropicRatio->GetString());
   width2 = metrics2.width(myTinyEdgeLength->GetString());
   width3 = metrics3.width(myBadElementAspectRatio->GetString());
index 3d1f25d09590feaedf1dc8842674329c807dcc06..a97a5acc616afa035046e7fe623ec7dd0db1f94e 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
@@ -78,7 +78,7 @@ SET(BLSURFPluginGUI_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${BLSURFPluginGUI_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${BLSURFPluginGUI_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
@@ -105,7 +105,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(BLSURFPluginGUI_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS})
@@ -118,4 +118,4 @@ INSTALL(TARGETS BLSURFPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${
 
 INSTALL(FILES ${BLSURFPluginGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_BLSURFPLUGIN_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_BLSURFPLUGIN_INSTALL_RES_DATA}")