Salome HOME
Remove QT4 compatibility.
authorrnv <rnv@opencascade.com>
Thu, 30 May 2019 12:00:51 +0000 (15:00 +0300)
committerrnv <rnv@opencascade.com>
Fri, 31 May 2019 13:23:57 +0000 (16:23 +0300)
CMakeLists.txt
src/HEXABLOCKGUI/HEXABLOCKGUI.cxx
src/HEXABLOCKGUI/klinkitemselectionmodel.hxx
src/HEXABLOCKGUI/kmodelindexproxymapper.cxx

index f5fea30cd38ded08837788f200ea855ad4cd49d2..82202ebabbe2af8902d2d4a4edf11a5f2c1cf61c 100644 (file)
@@ -116,11 +116,7 @@ IF(SALOME_BUILD_GUI)
     ADD_DEFINITIONS(${GUI_DEFINITIONS})
     # Various
     # Qt
-    IF (NOT SALOME_GUI_BUILD_WITH_QT5)
-      FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-    ELSE()
-      FIND_PACKAGE(SalomeQt5 REQUIRED)
-    ENDIF()
+    FIND_PACKAGE(SalomeQt5 REQUIRED)
   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 22d3ed788a30dd00d3b37bbed5d995531867b9e2..4c8cbe262e75993633f32e6ef409d91b1a3d5a18 100644 (file)
@@ -1003,10 +1003,7 @@ void HEXABLOCKGUI::createAndFillDockWidget()
     }
     aParent->tabifyDockWidget( _dwPattern, _dwGroups );
     aParent->tabifyDockWidget( _dwGroups, _dwMesh );
-
-#if QT_VERSION >= 0x040500
     aParent->setTabPosition(Qt::AllDockWidgetAreas, Resource::tabPanelsUp? QTabWidget::North: QTabWidget::South);
-#endif
 
     // popup menu on data tree view
     _patternDataTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
index e0d4ba81285caf25706cd39dc3020a6a7f2f63da..aadd7c9675bba4b3fb8fd70226ae01d539091976 100644 (file)
@@ -56,37 +56,6 @@ private:
 
 };
 
-
-// QAbstractProxyModel::mapSelectionFromSource creates invalid ranges to we filter
-// those out manually in a loop. Hopefully fixed in Qt 4.7.2, so we ifdef it out.
-// http://qt.gitorious.org/qt/qt/merge_requests/2474
-// http://qt.gitorious.org/qt/qt/merge_requests/831
-#if QT_VERSION < 0x040702
-#define RANGE_FIX_HACK
-#endif
-
-#ifdef RANGE_FIX_HACK
-static QItemSelection klink_removeInvalidRanges(const QItemSelection &selection)
-{
-//   std::cout<< " klink_removeInvalidRanges " << std::endl;
-  QItemSelection result;
-  Q_FOREACH(const QItemSelectionRange &range, selection)
-  {
-
-//    Q_FOREACH(const QModelIndex &i, range.indexes ())
-//    {
-////       std::cout<< " =====> " << i.data().toString().toStdString() << std::endl;
-//    }
-    if (!range.isValid())
-      continue;
-//     std::cout<< " is VALID !!"<< std::endl;
-    result << range;
-  }
-  return result;
-}
-#endif
-
-
 class KLinkItemSelectionModelPrivate
 {
 public:
@@ -120,15 +89,8 @@ void sourceSelectionChanged(const QItemSelection& selected, const QItemSelection
 
     
     Q_Q(KLinkItemSelectionModel);
-#ifdef RANGE_FIX_HACK
-//     std::cout<<"XXXXXXXXXXXXX  sourceSelectionChanged!!!!!!!! RANGE_FIX_HACK"<<std::endl;
-    QItemSelection _selected = klink_removeInvalidRanges(selected);
-    QItemSelection _deselected = klink_removeInvalidRanges(deselected);
-#else
-//     std::cout<<"XXXXXXXXXXXXX  sourceSelectionChanged!!!!!!!! "<<std::endl;
     QItemSelection _selected = selected;
     QItemSelection _deselected = deselected;
-#endif
     Q_ASSERT(assertSelectionValid(_selected));
     Q_ASSERT(assertSelectionValid(_deselected));
 
index 09e5429fe9d7c6a298364355049fde667e2ca4fa..3981f76f2a7681e8efc800110ac7595251377b35 100644 (file)
@@ -188,28 +188,6 @@ QModelIndex KModelIndexProxyMapper::mapRightToLeft(const QModelIndex& index) con
   return selection.indexes().first();
 }
 
-// QAbstractProxyModel::mapSelectionFromSource creates invalid ranges to we filter
-// those out manually in a loop. Hopefully fixed in Qt 4.7.2, so we ifdef it out.
-// http://qt.gitorious.org/qt/qt/merge_requests/2474
-// http://qt.gitorious.org/qt/qt/merge_requests/831
-#if QT_VERSION < 0x040702
-#define RANGE_FIX_HACK
-#endif
-
-#ifdef RANGE_FIX_HACK
-static QItemSelection removeInvalidRanges(const QItemSelection &selection)
-{
-  QItemSelection result;
-  Q_FOREACH(const QItemSelectionRange &range, selection)
-  {
-    if (!range.isValid())
-      continue;
-    result << range;
-  }
-  return result;
-}
-#endif
-
 QItemSelection KModelIndexProxyMapper::mapSelectionLeftToRight(const QItemSelection& selection) const
 {
   Q_D(const KModelIndexProxyMapper);
@@ -232,9 +210,6 @@ QItemSelection KModelIndexProxyMapper::mapSelectionLeftToRight(const QItemSelect
       return QItemSelection();
     seekSelection = proxy.data()->mapSelectionToSource(seekSelection);
 
-#ifdef RANGE_FIX_HACK
-    seekSelection = removeInvalidRanges(seekSelection);
-#endif
     Q_ASSERT(d->assertSelectionValid(seekSelection));
   }
 
@@ -247,9 +222,6 @@ QItemSelection KModelIndexProxyMapper::mapSelectionLeftToRight(const QItemSelect
       return QItemSelection();
     seekSelection = proxy.data()->mapSelectionFromSource(seekSelection);
 
-#ifdef RANGE_FIX_HACK
-    seekSelection = removeInvalidRanges(seekSelection);
-#endif
     Q_ASSERT(d->assertSelectionValid(seekSelection));
   }
 
@@ -280,9 +252,6 @@ QItemSelection KModelIndexProxyMapper::mapSelectionRightToLeft(const QItemSelect
       return QItemSelection();
     seekSelection = proxy.data()->mapSelectionToSource(seekSelection);
 
-#ifdef RANGE_FIX_HACK
-    seekSelection = removeInvalidRanges(seekSelection);
-#endif
     Q_ASSERT(d->assertSelectionValid(seekSelection));
   }
 
@@ -296,9 +265,6 @@ QItemSelection KModelIndexProxyMapper::mapSelectionRightToLeft(const QItemSelect
       return QItemSelection();
     seekSelection = proxy.data()->mapSelectionFromSource(seekSelection);
 
-#ifdef RANGE_FIX_HACK
-    seekSelection = removeInvalidRanges(seekSelection);
-#endif
     Q_ASSERT(d->assertSelectionValid(seekSelection));
   }