Salome HOME
Fix for bug IPAL19810(Qt4 porting: Modification - Smoothing after operation cursor...
authormzn <mzn@opencascade.com>
Tue, 3 Jun 2008 11:47:27 +0000 (11:47 +0000)
committermzn <mzn@opencascade.com>
Tue, 3 Jun 2008 11:47:27 +0000 (11:47 +0000)
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx

index 54171c5a0589d7f1d26334bf6327a837d78af11b..6bfeddee0194c78eb61a3381c2c90779f288c265 100644 (file)
@@ -39,6 +39,8 @@
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Study.h>
+#include <SUIT_OverrideCursor.h>
+
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SALOME_ListIO.hxx>
@@ -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;
index c3f65fdc2291dc26fc7c63ad189ca99623e6670b..3aaf82c3594bb66a07884d943e4bf142a1de2ba2 100644 (file)
@@ -42,6 +42,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ViewManager.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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"<<exc.details.text);
          }catch(std::exception& exc){
@@ -472,10 +472,9 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
            anIdsOfFaces[i] = aListId[i].toInt();
          
          try{
+           SUIT_OverrideCursor aWaitCursor;
            SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
-           QApplication::setOverrideCursor(Qt::WaitCursor);
            aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
-           QApplication::restoreOverrideCursor();
          }catch(SALOME::SALOME_Exception& exc){
            INFOS("Follow exception was cought:\n\t"<<exc.details.text);
          }catch(std::exception& exc){
index 8c64a16130cd00ceb707014d647d7e1de7dd851a..e080369aac9972c352e62e6f96a77e005eb002a7 100644 (file)
@@ -42,6 +42,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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();
index 7f8ac16736db8c7f1ec7862d05e9dc8055659afa..788cb76d60f8db5ca85d8ad1692d6f360d94269b 100644 (file)
@@ -44,6 +44,7 @@
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Session.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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 (...) {
     }
 
index c75eaee3de8a6783e1a298e3a0dd6052482e342f..992620883fe3f4fa0ea65a5e5613e364fdd0834e 100644 (file)
@@ -38,6 +38,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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(...) {
     }
index d5fe19e5fa9b6f3af983753a19bbfd3dbd5e80e9..6e7587fe975347650e4355fd1f8b200c6b62d8e2 100644 (file)
@@ -43,6 +43,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Desktop.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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 (...) {
     }
 
index 4a6f93a01680c725e9320771a63465aad66919de..6356d73d683309895d1b75f5465fa380b026ac45 100644 (file)
@@ -43,6 +43,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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 (...) {
     }
 
index cec3e4265ce2f7fc17cbe72a50f1486143bf85e5..7da9fcf76d50747d1c1000e7eb60169ad634c11b 100644 (file)
@@ -40,6 +40,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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);
index b1562d899b4ea6ef7518fb4d7ad38dcf1a29edf5..f284df459bf8794c7d14aa7827ca9730dd088be3 100644 (file)
@@ -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 (...) {
     }
 
index 744c71109bcf71eb19b299c4ef461f7c284df165..e8e6d89db274f8c434ff233fe6824b23b8b7a22f 100644 (file)
@@ -43,6 +43,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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 (...) {
     }
 
index f82fc758451d41e6c5f67aabdc336360a32cb56a..c1ba6198b6c5e9ec8c9571563df7ad300370e0ec 100644 (file)
@@ -43,6 +43,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -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 (...) {
     }