From: mzn Date: Tue, 3 Jun 2008 11:47:27 +0000 (+0000) Subject: Fix for bug IPAL19810(Qt4 porting: Modification - Smoothing after operation cursor... X-Git-Tag: V5_1_0a1~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6c3c99ea8d235331db98b0ca62611bc003e79aab;p=modules%2Fsmesh.git Fix for bug IPAL19810(Qt4 porting: Modification - Smoothing after operation cursor remains to be "watches"). --- diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 54171c5a0..6bfeddee0 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -39,6 +39,8 @@ #include #include #include +#include + #include #include #include @@ -281,8 +283,8 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() return false; if (!myMesh->_is_nil()) { try { - QApplication::setOverrideCursor(Qt::WaitCursor); - + SUIT_OverrideCursor aWaitCursor; + SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); // concatenate meshes SMESH::SMESH_Mesh_var aCompoundMesh = @@ -292,7 +294,6 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() SpinBoxTol->GetValue()); SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() ); - QApplication::restoreOverrideCursor(); mySMESHGUI->updateObjBrowser(); } catch(...) { return false; diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index c3f65fdc2..3aaf82c35 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -450,10 +451,9 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() anIdsOfNodes[aNbIdsOfNodes++] = It.Value(); try{ + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities); - QApplication::restoreOverrideCursor(); }catch(SALOME::SALOME_Exception& exc){ INFOS("Follow exception was cought:\n\t"<GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces); - QApplication::restoreOverrideCursor(); }catch(SALOME::SALOME_Exception& exc){ INFOS("Follow exception was cought:\n\t"< #include #include +#include #include #include @@ -581,10 +582,9 @@ bool SMESHGUI_EditMeshDlg::ClickOnApply() return false; try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); - SMESH::long_array_var anIds = new SMESH::long_array; SMESH::array_of_long_array_var aGroupsOfElements = new SMESH::array_of_long_array; @@ -606,7 +606,6 @@ bool SMESHGUI_EditMeshDlg::ClickOnApply() else aMeshEditor->MergeElements (aGroupsOfElements.inout()); - QApplication::restoreOverrideCursor(); } catch(...) { } @@ -712,9 +711,9 @@ void SMESHGUI_EditMeshDlg::onDetect() return; try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); ListCoincident->clear(); ListEdit->clear(); @@ -744,8 +743,7 @@ void SMESHGUI_EditMeshDlg::onDetect() ListCoincident->addItem(anIDs.join(" ")); } - QApplication::restoreOverrideCursor(); - } catch(...) { + } catch(...) { } ListCoincident->selectAll(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 7f8ac1673..788cb76d6 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -368,8 +369,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() long aNbSteps = (long)SpinBox_NbSteps->value(); try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) SMESH::ListOfGroups_var groups = @@ -377,7 +378,6 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() else aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps); - QApplication::restoreOverrideCursor(); } catch (...) { } diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx index c75eaee3d..992620883 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -226,7 +227,7 @@ void SMESHGUI_RenumberingDlg::ClickOnApply() if (isUnitsLabeled) anActor->SetCellsLabeled(false); } - QApplication::setOverrideCursor(Qt::WaitCursor); + SUIT_OverrideCursor aWaitCursor; if (myUnit == 0) { aMeshEditor->RenumberNodes(); if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true); @@ -235,7 +236,6 @@ void SMESHGUI_RenumberingDlg::ClickOnApply() aMeshEditor->RenumberElements(); if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true); } - QApplication::restoreOverrideCursor(); } catch(...) { } diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index d5fe19e5f..6e7587fe9 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -423,17 +424,15 @@ void SMESHGUI_RevolutionDlg::ClickOnApply() double aTolerance = SpinBox_Tolerance->GetValue(); try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); - + if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) SMESH::ListOfGroups_var groups = aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance); else aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance); - - QApplication::restoreOverrideCursor(); } catch (...) { } diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 4a6f93a01..6356d73d6 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -381,8 +382,8 @@ void SMESHGUI_RotationDlg::ClickOnApply() int actionButton = ActionGroup->checkedId(); bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ); try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); switch ( actionButton ) { case MOVE_ELEMS_BUTTON: aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false); @@ -399,7 +400,6 @@ void SMESHGUI_RotationDlg::ClickOnApply() aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups, LineEditNewMesh->text().toLatin1().data()); } - QApplication::restoreOverrideCursor(); } catch (...) { } diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index cec3e4265..7da9fcf76 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -458,8 +459,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() bool toCreatePolyedrs = CheckBoxPolyedrs->isChecked(); try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); int aConstructorId = GetConstructorId(); SMESH::SMESH_MeshEditor::Sew_Error anError; @@ -514,8 +515,6 @@ bool SMESHGUI_SewingDlg::ClickOnApply() if (toMerge && aResult) aMeshEditor->MergeEqualElements(); - QApplication::restoreOverrideCursor(); - if (!aResult) { QString msg = tr(QString("ERROR_%1").arg(anError).toLatin1().data()); SUIT_MessageBox::warning(this, tr("SMESH_WRN_WARNING"), msg); diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index b1562d899..f284df459 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -340,15 +340,15 @@ void SMESHGUI_SmoothingDlg::ClickOnApply() bool aResult = false; try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); + if ( CheckBoxParametric->isChecked() ) aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(), anIterationLimit, aMaxAspectRatio, aMethod); else aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(), anIterationLimit, aMaxAspectRatio, aMethod); - QApplication::restoreOverrideCursor(); } catch (...) { } diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 744c71109..e8e6d89db 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -468,8 +469,9 @@ void SMESHGUI_SymmetryDlg::ClickOnApply() bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ); try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); + switch ( actionButton ) { case MOVE_ELEMS_BUTTON: aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false ); @@ -486,7 +488,6 @@ void SMESHGUI_SymmetryDlg::ClickOnApply() aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups, LineEditNewMesh->text().toLatin1().data()); } - QApplication::restoreOverrideCursor(); } catch (...) { } diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index f82fc7584..c1ba6198b 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -436,8 +437,8 @@ void SMESHGUI_TranslationDlg::ClickOnApply() int actionButton = ActionGroup->checkedId(); bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ); try { + SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - QApplication::setOverrideCursor(Qt::WaitCursor); switch ( actionButton ) { case MOVE_ELEMS_BUTTON: aMeshEditor->Translate(anElementsId, aVector, false); @@ -454,7 +455,6 @@ void SMESHGUI_TranslationDlg::ClickOnApply() aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups, LineEditNewMesh->text().toLatin1().data()); } - QApplication::restoreOverrideCursor(); } catch (...) { }