From: rnv Date: Thu, 30 May 2019 11:57:29 +0000 (+0300) Subject: Remove QT4 compatibility. X-Git-Tag: V9_4_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9157430337e6e7291578bcfd877621f8623654c1;p=modules%2Fgeom.git Remove QT4 compatibility. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 940ceeed0..2ce9d649e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,17 +139,10 @@ ENDIF(SALOME_BUILD_GUI) ## IF(SALOME_BUILD_GUI) - IF(NOT SALOME_GUI_BUILD_WITH_QT5) - # Qt - FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork) - # PyQt - FIND_PACKAGE(SalomePyQt4 REQUIRED) - ELSE() - # Qt - FIND_PACKAGE(SalomeQt5 REQUIRED) - # PyQt - FIND_PACKAGE(SalomePyQt5 REQUIRED) - ENDIF() + # Qt + FIND_PACKAGE(SalomeQt5 REQUIRED) + # PyQt + FIND_PACKAGE(SalomePyQt5 REQUIRED) ENDIF(SALOME_BUILD_GUI) ## diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index 835627529..b512c2926 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -156,13 +156,8 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget* parent columnNames.append( tr( "GEOM_EDGE" )); columnNames.append( tr( "GEOM_FACE_CONSTRAINT" ) ); myTreeConstraints->setHeaderLabels( columnNames ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - myTreeConstraints->header()->setMovable( false ); - myTreeConstraints->header()->setResizeMode( QHeaderView::ResizeToContents ); -#else myTreeConstraints->header()->setSectionsMovable( false ); myTreeConstraints->header()->setSectionResizeMode( QHeaderView::ResizeToContents ); -#endif myTreeConstraints->setMinimumHeight( 140 ); QHBoxLayout* l = new QHBoxLayout( myGroupWireConstraints->Box ); diff --git a/src/CurveCreator/CurveCreator_TreeView.cxx b/src/CurveCreator/CurveCreator_TreeView.cxx index b9b62d909..77010c349 100644 --- a/src/CurveCreator/CurveCreator_TreeView.cxx +++ b/src/CurveCreator/CurveCreator_TreeView.cxx @@ -212,14 +212,9 @@ int CurveCreator_TreeViewModel::getPoint( const QModelIndex& theIndx ) const void CurveCreator_TreeViewModel::setCurve( CurveCreator_ICurve* theCurve ) { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - myCurve = theCurve; - reset(); -#else beginResetModel(); myCurve = theCurve; endResetModel(); -#endif } /*****************************************************************************************/ @@ -227,11 +222,7 @@ CurveCreator_TreeView::CurveCreator_TreeView( CurveCreator_ICurve* theCurve, QWi QTreeView(parent) { header()->hide(); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - header()->setResizeMode(QHeaderView::ResizeToContents); -#else header()->setSectionResizeMode(QHeaderView::ResizeToContents); -#endif setUniformRowHeights(true); setContextMenuPolicy( Qt::CustomContextMenu ); CurveCreator_TreeViewModel* aModel = new CurveCreator_TreeViewModel(theCurve, this); diff --git a/src/DependencyTree/DependencyTree_Arrow.cxx b/src/DependencyTree/DependencyTree_Arrow.cxx index 7abaf6853..179672d16 100644 --- a/src/DependencyTree/DependencyTree_Arrow.cxx +++ b/src/DependencyTree/DependencyTree_Arrow.cxx @@ -39,11 +39,7 @@ const qreal arrowSize = 20; DependencyTree_Arrow::DependencyTree_Arrow( DependencyTree_Object* theStartItem, DependencyTree_Object* theEndItem, QGraphicsItem* parent, QGraphicsScene* scene ) -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -:QGraphicsLineItem( parent, scene ), -#else :QGraphicsLineItem( parent ), -#endif myIsBiLink( false ), myStartItem( theStartItem ), myEndItem( theEndItem ) diff --git a/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx b/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx index 5b3800267..5b36aee23 100644 --- a/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx @@ -47,11 +47,7 @@ GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app ) myParamsTreeWd->setColumnCount( 2 ); myParamsTreeWd->setHeaderLabels( QStringList() << tr( "PARAMETER" ) << tr( "VALUE" ) ); myParamsTreeWd->header()->setStretchLastSection( true ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - myParamsTreeWd->header()->setResizeMode( 0, QHeaderView::ResizeToContents ); -#else myParamsTreeWd->header()->setSectionResizeMode( 0, QHeaderView::ResizeToContents ); -#endif QVBoxLayout* aLayout = new QVBoxLayout( this ); aLayout->addWidget( myParamsTreeWd ); diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx index f1fb475a0..9c35641d6 100644 --- a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx @@ -175,11 +175,8 @@ GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app ) headerItem->setIcon( 1, myVisibleIcon ); setHeaderItem ( headerItem ); header()->moveSection( 1, 0 ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - header()->setResizeMode( 1, QHeaderView::ResizeToContents ); -#else header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents ); -#endif + QStringList rootNames; rootNames << tr("GEOM_DIMENSIONS") << ""; myDimensionsItem = new QTreeWidgetItem( this, rootNames ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx index 8de043d28..8e688938c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx @@ -78,11 +78,7 @@ GEOMToolsGUI_PublishDlg::GEOMToolsGUI_PublishDlg(QWidget* parent): SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); headerItem->setIcon( 2, QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ) ); myTreeWidget->setHeaderItem ( headerItem ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - myTreeWidget->header()->setClickable( true ); -#else myTreeWidget->header()->setSectionsClickable( true ); -#endif myTreeWidget->header()->setSortIndicatorShown( true ); myTreeWidget->header()->moveSection( 2, 0 ); myTreeWidget->setSortingEnabled( true ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx index 41f35f48b..feb742897 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx @@ -219,15 +219,10 @@ void GEOMToolsGUI_ReduceStudyDlg::createTreeWidget( QTreeWidget* theTreeWidget ) QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames ); theTreeWidget->setHeaderItem ( headerItem ); theTreeWidget->header()->moveSection( 1, 0 ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - theTreeWidget->header()->setClickable( true ); - theTreeWidget->header()->setMovable( false ); - theTreeWidget->header()->setResizeMode( 1, QHeaderView::ResizeToContents ); -#else theTreeWidget->header()->setSectionsClickable( true ); theTreeWidget->header()->setSectionsMovable( false ); theTreeWidget->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents ); -#endif + theTreeWidget->setSelectionMode( QAbstractItemView::ExtendedSelection ); } diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index 2d0e91f98..522ec667d 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -158,11 +158,8 @@ namespace const int nbCols = 2; QTableWidget* table = new QTableWidget( nbRows, nbCols, this ); table->setEditTriggers( QAbstractItemView::NoEditTriggers ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - table->horizontalHeader()->setResizeMode( 1, QHeaderView::Interactive ); -#else table->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::Interactive ); -#endif + table->horizontalHeader()->setStretchLastSection( true ); QStringList headers; diff --git a/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx b/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx index 78d937580..b59e84017 100644 --- a/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx +++ b/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx @@ -417,15 +417,10 @@ void RepairGUI_InspectObjectDlg::createTreeWidget(QTreeWidget *&theTreeObjects) headerItem->setIcon(1, myInvisible); theTreeObjects->setHeaderItem(headerItem); theTreeObjects->header()->moveSection(1, 0); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - theTreeObjects->header()->setClickable(true); - theTreeObjects->header()->setMovable(false); - theTreeObjects->header()->setResizeMode( 1, QHeaderView::ResizeToContents); -#else theTreeObjects->header()->setSectionsClickable(true); theTreeObjects->header()->setSectionsMovable(false); theTreeObjects->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents); -#endif + theTreeObjects->setSelectionMode(QAbstractItemView::ExtendedSelection); theTreeObjects->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed); // set custom item delegate