From 0facb10106106de69e97b5c67b09b8416fd82fa6 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 30 May 2019 14:57:29 +0300 Subject: [PATCH] Remove QT4 compatibility. --- src/BuildGUI/BuildGUI_FaceDlg.cxx | 5 ----- src/CurveCreator/CurveCreator_TreeView.cxx | 9 --------- src/DependencyTree/DependencyTree_Arrow.cxx | 4 ---- src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx | 4 ---- src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx | 5 +---- src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx | 4 ---- src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx | 7 +------ src/RepairGUI/RepairGUI.cxx | 5 +---- src/RepairGUI/RepairGUI_InspectObjectDlg.cxx | 7 +------ 9 files changed, 4 insertions(+), 46 deletions(-) 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 -- 2.39.2