From 3412372987bd5341493b61d7991b4350caedc155 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 5 Mar 2015 16:37:28 +0300 Subject: [PATCH] Fix usage of SUIT_OverrideCursor - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; --- src/DisplayGUI/DisplayGUI.cxx | 18 +++++++++--------- src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 12 ++++++------ .../GEOMToolsGUI_TransparencyDlg.cxx | 4 ++-- src/MeasureGUI/MeasureGUI.cxx | 2 +- src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx | 2 +- .../MeasureGUI_CheckSelfIntersectionsDlg.cxx | 2 ++ src/MeasureGUI/MeasureGUI_DistanceDlg.cxx | 2 +- .../MeasureGUI_FastCheckIntersectionsDlg.cxx | 2 ++ src/MeasureGUI/MeasureGUI_Skeleton.cxx | 2 +- src/RepairGUI/RepairGUI_FreeFacesDlg.cxx | 2 +- 10 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index 88a717ef2..05cfca53d 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -189,7 +189,7 @@ void DisplayGUI::DisplayAll() _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( SC ) ); anIter->InitEx( true ); - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; while( anIter->More() ) { _PTR(SObject) valSO ( anIter->Value() ); @@ -210,7 +210,7 @@ void DisplayGUI::DisplayAll() //===================================================================================== void DisplayGUI::EraseAll() { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; SUIT_Application* app = getGeometryGUI()->getApp(); if ( app ) { @@ -261,7 +261,7 @@ void DisplayGUI::DisplayOnlyChildren() aSelMgr->selectedObjects(aList, "ObjectBrowser", false); SALOME_ListIteratorOfListIO It (aList); - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; for (; It.More(); It.Next()) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); @@ -314,7 +314,7 @@ void DisplayGUI::Display() aSelMgr->selectedObjects( aList ); SALOME_ListIteratorOfListIO It( aList ); - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; for( ;It.More();It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); @@ -372,7 +372,7 @@ void DisplayGUI::Erase() aSelMgr->selectedObjects( aList ); SALOME_ListIteratorOfListIO It( aList ); - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; for( ; It.More(); It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); @@ -420,7 +420,7 @@ void DisplayGUI::Erase() //===================================================================================== void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; @@ -453,7 +453,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) //===================================================================================== void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; @@ -499,7 +499,7 @@ int DisplayGUI::GetVectorMode( SUIT_ViewWindow* viewWindow ) //===================================================================================== void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; @@ -558,7 +558,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); if ( !aStudy ) return; - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; SALOME_ListIO selected; aSelMgr->selectedObjects( selected ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 21dafed12..d00c98d24 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -191,7 +191,7 @@ void GEOMToolsGUI::OnAutoColor() QColor c( (int)( aColor.R * 255.0 ), (int)( aColor.G * 255.0 ), (int)( aColor.B * 255.0 ) ); - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; appStudy->setObjectProperty( aMgrId, aChildObject->GetStudyEntry(), GEOM::propertyName( GEOM::Color ), c ); Handle( SALOME_InteractiveObject ) io = new SALOME_InteractiveObject( aChildObject->GetStudyEntry(), "GEOM", "" ); @@ -272,7 +272,7 @@ void GEOMToolsGUI::OnColor() aSColor.B = (double)color.blue() / 255.0; // iterate through list of objects and assign new color - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value(); GEOM::GEOM_Object_var aObject = GEOMBase::ConvertIOinGEOMObject( io ); @@ -417,7 +417,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) NbIsosDlg->setV( VIso ); if ( NbIsosDlg->exec() ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; newNbUIso = NbIsosDlg->getU(); newNbVIso = NbIsosDlg->getV(); } else //Cancel case @@ -473,7 +473,7 @@ void GEOMToolsGUI::OnDeflection() ( SUIT_Session::session()->activeApplication()->desktop() ); DeflectionDlg->setTheDC( aDC ); if ( DeflectionDlg->exec() ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; aDC = DeflectionDlg->getTheDC(); for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { @@ -674,7 +674,7 @@ void GEOMToolsGUI::OnEdgeWidth() Dlg->setTheLW( aWidth ); if ( Dlg->exec() ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; aWidth = Dlg->getTheLW(); } else return; //Cancel case @@ -717,7 +717,7 @@ void GEOMToolsGUI::OnIsosWidth() { Dlg->setTheLW( aWidth ); if ( Dlg->exec() ) { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; aWidth = Dlg->getTheLW(); } else return; //Cancel case diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx index 6a0ebc6f8..7a2db9305 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -282,7 +282,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency() return; } - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { aView->SetTransparency( It.Value(), newValue ); aStudy->setObjectProperty( aMgrId , It.Value()->getEntry(), GEOM::propertyName( GEOM::Transparency ) , newValue ); @@ -306,7 +306,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency() return; } - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; OCCViewer_Viewer* vm = dynamic_cast( window->getViewManager()->getViewModel() ); if ( !vm ) return; diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index edbb4b9a6..37c8ed4b2 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -195,7 +195,7 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible ) return; } - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() ); diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 9a3567ce9..56b10a092 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -329,7 +329,7 @@ void MeasureGUI_BndBoxDlg::redisplayPreview() erasePreview(false); try { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; getDisplayer()->SetColor(Quantity_NOC_VIOLET); getDisplayer()->SetToActivate(false); diff --git a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx index f58b0c3a8..a07e919e5 100644 --- a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx @@ -410,6 +410,8 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::findSelfIntersections int nbPairs = 0; int aLevel = myLevelBox->currentIndex(); + SUIT_OverrideCursor wc; + try { HasSelfInte = !anOper->CheckSelfIntersections(myObj, aLevel, myInters); nbPairs = myInters->length()/2; diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx index e92d45590..a2b0dc16c 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -511,7 +511,7 @@ void MeasureGUI_DistanceDlg::redisplayPreview() erasePreview(false); try { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; getDisplayer()->SetColor(Quantity_NOC_VIOLET); getDisplayer()->SetToActivate(false); diff --git a/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx index a12434301..459501c3c 100644 --- a/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx @@ -228,6 +228,8 @@ void MeasureGUI_FastCheckIntersectionsDlg::clear() //================================================================================= void MeasureGUI_FastCheckIntersectionsDlg::onCompute() { + SUIT_OverrideCursor wc; + myShapeList1->clear(); myShapeList2->clear(); diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx index 6bcfe743b..50667f491 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.cxx +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -324,7 +324,7 @@ void MeasureGUI_Skeleton::redisplayPreview() erasePreview( false ); try { - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; getDisplayer()->SetColor( Quantity_NOC_VIOLET ); getDisplayer()->SetToActivate( false ); diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx index bc7aa61a8..395bf5301 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx @@ -286,7 +286,7 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects ) return false; } - SUIT_OverrideCursor(); + SUIT_OverrideCursor wc; TopExp::MapShapes( aSelShape, anIndices); SALOME_Prs* aPrs = 0;