Salome HOME
Wait cursor for solver operation
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index 5cf57b2aabedd86da81bea8d71135418680bfb3c..fe055eff44b0b246d1c2bc802299aa48d083eb60 100644 (file)
@@ -264,10 +264,11 @@ void XGUI_Workshop::processEvent(const Events_Message* theMessage)
     return;
   }
 
-  if (theMessage->eventID() == Events_Loop::loop()->eventByName("LongOperation")) {
+  if (theMessage->eventID() == Events_LongOp::eventID()) {
     if (Events_LongOp::isPerformed())
       QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-    else
+      //QTimer::singleShot(10, this, SLOT(onStartWaiting()));
+    else 
       QApplication::restoreOverrideCursor();
     return;
   }
@@ -294,6 +295,14 @@ void XGUI_Workshop::processEvent(const Events_Message* theMessage)
   }
 }
 
+//******************************************************
+void XGUI_Workshop::onStartWaiting()
+{
+  if (Events_LongOp::isPerformed()) {
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+  }
+}
+
 //******************************************************
 void XGUI_Workshop::onFeatureUpdatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
 {