]> SALOME platform Git repositories - modules/hexablock.git/commitdiff
Salome HOME
Merge Qt5 porting.
authorimn <imn@opencascade.com>
Thu, 26 Nov 2015 14:44:01 +0000 (17:44 +0300)
committerrnv <rnv@opencascade.com>
Wed, 23 Dec 2015 15:04:34 +0000 (18:04 +0300)
CMakeLists.txt
src/HEXABLOCKGUI/CMakeLists.txt
src/HEXABLOCKGUI/HEXABLOCKGUI.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.cxx
src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx
src/HEXABLOCKGUI/MyDlgRef/CMakeLists.txt

index fe6353f8d273ca714ff8ed9d6409527d78efe313..ecc57eaff2ed5b7d9a4f1c18dc84d1d137dced6a 100755 (executable)
@@ -103,8 +103,12 @@ IF(SALOME_BUILD_GUI)
                     OPTIONAL SALOME_USE_PYCONSOLE)
     ADD_DEFINITIONS(${GUI_DEFINITIONS})
     # Various
-    # 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 10cd354fcf0f58e0ff82b9e3189b0faaf05348ed..68190e3d580c9a85c4b3b96c529127bc3c27a6de 100644 (file)
@@ -19,7 +19,7 @@
 
 ADD_SUBDIRECTORY(MyDlgRef)
 
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # --- options ---
 # additional include directories
@@ -91,7 +91,7 @@ SET(HEXABLOCK_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
@@ -170,7 +170,7 @@ SET(_pyuic_files
 )
 
 # scripts / pyuic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_pyuic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_pyuic_files})
 
 # sources / to compile
 SET(HEXABLOCK_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS})
@@ -246,11 +246,12 @@ SET(_other_RESOURCES
 
 ADD_LIBRARY(HEXABLOCK ${HEXABLOCK_SOURCES})
 TARGET_LINK_LIBRARIES(HEXABLOCK ${_link_LIBRARIES} )
+SET_TARGET_PROPERTIES(HEXABLOCK PROPERTIES COMPILE_DEFINITIONS QT_DISABLE_DEPRECATED_BEFORE=0 )
 INSTALL(TARGETS HEXABLOCK EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 INSTALL(FILES ${HEXABLOCK_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_HEXABLOCK_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_HEXABLOCK_INSTALL_RES_DATA}")
 
 INSTALL(FILES ${_other_RESOURCES}
         DESTINATION ${SALOME_HEXABLOCK_INSTALL_RES_DATA})
index 63692c5241c52af06fe778ed2263a93c1edd3e5d..ce168b51c1196d0cef5462ef110f406a473de88d 100755 (executable)
@@ -25,6 +25,8 @@
 #include <QInputDialog>
 #include <QIcon>
 #include <QStackedWidget>
+#include <QMenu>
+#include <QSplitter>
 
 #include <QtxTreeView.h>
 #include <SUIT_MessageBox.h>
index 4cd0be440a8fab1e29e9b22931984ab9594843f1..cb33677bfcdc64b9e0019c09fe7fd99b91d7bf82 100755 (executable)
@@ -42,7 +42,7 @@ QStandardItem()
        {
                setText(m_DocElt->getName());
                if ( m_DocElt->isAssociated() )
-                   setData(Qt::darkGreen, Qt::ForegroundRole);
+                   setData(QColor(Qt::darkGreen), Qt::ForegroundRole);
        }
        setData( treeRole,    HEXA_TREE_ROLE );
        setData( entry,       HEXA_DOC_ENTRY_ROLE);
index 76cfb961131249c7062a77b3a4f5b875bdbe0dc8..2b2e9841a0519b2670277e916586c3e6158440bc 100755 (executable)
@@ -27,6 +27,7 @@
 #include <iostream>
 #include <QtGui>
 #include <QFlags>
+#include <QStyledItemDelegate>
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
index c8958c6b03645b97d007da43e9c682109d4e7d11..0b9a14c02d9b7e1f98ff2f5505645bf64b52a7dd 100755 (executable)
@@ -326,8 +326,8 @@ void PatternDataSelectionModel::highlightTreeItems(QModelIndexList& indexes,
     {
         if (anItemIndex.isValid())
         {
-            theModel->setData(anItemIndex, fgColor, Qt::ForegroundRole);
-            theModel->setData(anItemIndex, bgColor, Qt::BackgroundRole);
+            theModel->setData(anItemIndex, QColor(fgColor), Qt::ForegroundRole);
+            theModel->setData(anItemIndex, QColor(bgColor), Qt::BackgroundRole);
             currentHighlightedItems << anItemIndex;
         }
     }
@@ -350,8 +350,8 @@ void PatternDataSelectionModel::unhighlightTreeItems(bool clearSelected)
     {
         if (anItemIndex.isValid())
         {
-            theModel->setData(anItemIndex, Qt::darkGreen, Qt::ForegroundRole);
-            theModel->setData(anItemIndex, Qt::white, Qt::BackgroundRole);
+            theModel->setData(anItemIndex, QColor(Qt::darkGreen), Qt::ForegroundRole);
+            theModel->setData(anItemIndex, QColor(Qt::white), Qt::BackgroundRole);
         }
     }
     currentHighlightedItems.clear();
@@ -591,8 +591,8 @@ void PatternGeomSelectionModel::highlightTreeItems(QModelIndexList& indexes,
     {
         if (anItemIndex.isValid())
         {
-            theModel->setData(anItemIndex, fgColor, Qt::ForegroundRole);
-            theModel->setData(anItemIndex, bgColor, Qt::BackgroundRole);
+            theModel->setData(anItemIndex, QColor(fgColor), Qt::ForegroundRole);
+            theModel->setData(anItemIndex, QColor(bgColor), Qt::BackgroundRole);
             currentHighlightedItems << anItemIndex;
         }
     }
@@ -614,8 +614,8 @@ void PatternGeomSelectionModel::unhighlightTreeItems(bool clearSelected)
     {
         if (anItemIndex.isValid())
         {
-            theModel->setData(anItemIndex, Qt::darkGreen, Qt::ForegroundRole);
-            theModel->setData(anItemIndex, Qt::white, Qt::BackgroundRole);
+            theModel->setData(anItemIndex, QColor(Qt::darkGreen), Qt::ForegroundRole);
+            theModel->setData(anItemIndex, QColor(Qt::white), Qt::BackgroundRole);
         }
     }
     currentHighlightedItems.clear();
index 4882a13022df4b6587c0f93e60948ff14eb96718..66be6ed72ad92985b687f43522d88785afed6c72 100755 (executable)
@@ -33,6 +33,8 @@
 #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
 #include "HEXABLOCKGUI.hxx"
 
+#include <QScrollBar>
+
 #ifndef M_PI
 #define M_PI 3.1415927
 #endif
index eb1e5db670891835cf993e79364b4ba0d4418afe..aefa4ffda34a7876451c4efe4a49a312f948872e 100644 (file)
@@ -968,13 +968,13 @@ void MyBasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
         }
     }
     else if (id == GEOM_POINT_SURF) {
-        GroupOnSurface->TextLabel2->setShown(isParam);
-        GroupOnSurface->TextLabel3->setShown(isParam);
-        GroupOnSurface->SpinBox_DX->setShown(isParam);
-        GroupOnSurface->SpinBox_DY->setShown(isParam);
+        GroupOnSurface->TextLabel2->setVisible(isParam);
+        GroupOnSurface->TextLabel3->setVisible(isParam);
+        GroupOnSurface->SpinBox_DX->setVisible(isParam);
+        GroupOnSurface->SpinBox_DY->setVisible(isParam);
     }
 
-    GroupXYZ->setShown(!isParam && !isLength);
+    GroupXYZ->setVisible(!isParam && !isLength);
 }
 
 //=================================================================================
index bfeeb414e649f1b5445ee61cdd9827465aa34731..25fd40ccc456719f1ef3cb5186673b4550e41cdd 100644 (file)
@@ -17,6 +17,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(UseQtExt)
+
 # --- options ---
 # additional include directories
 INCLUDE_DIRECTORIES(
@@ -41,7 +43,7 @@ SET(MyDlgRef_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${MyDlgRef_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${MyDlgRef_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
@@ -60,7 +62,7 @@ SET(_pyuic_files
 )
 
 # scripts / pyuic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_pyuic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_pyuic_files})
 
 # sources / to compile
 SET(MyDlgRef_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS})