From 9c08f98c8b7b687f03b8994451a0cebdd5ca2fad Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 30 May 2019 15:00:51 +0300 Subject: [PATCH] Remove QT4 compatibility. --- CMakeLists.txt | 6 +--- src/HEXABLOCKGUI/HEXABLOCKGUI.cxx | 3 -- src/HEXABLOCKGUI/klinkitemselectionmodel.hxx | 38 -------------------- src/HEXABLOCKGUI/kmodelindexproxymapper.cxx | 34 ------------------ 4 files changed, 1 insertion(+), 80 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5fea30..82202eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index 22d3ed7..4c8cbe2 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -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); diff --git a/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx b/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx index e0d4ba8..aadd7c9 100644 --- a/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx +++ b/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx @@ -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"<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)); } -- 2.39.2