Salome HOME
SUPERV5833
authorsmh <smh@opencascade.com>
Thu, 6 May 2004 12:56:25 +0000 (12:56 +0000)
committersmh <smh@opencascade.com>
Thu, 6 May 2004 12:56:25 +0000 (12:56 +0000)
src/SUPERVGUI/Makefile.in
src/SUPERVGUI/SUPERVGUI_Main.cxx

index 15982529e06ebca216cd4debee3bc19686aeb5c1..1cb62bb07e471082af60977f3207d313252e6175 100644 (file)
@@ -96,7 +96,7 @@ LIB_SERVER_IDL =
 CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \
          -ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome
 LDFLAGS+=$(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) $(PYTHON_LIBS)\
-        -lSalomeGUI -lSalomeNS -lqsplitterP \
+        -lSalomeGUI -lSalomeNS -lqsplitterP -lEvent \
         -lSalomeLifeCycleCORBA -lSalomeNotification -lSUPERVGraph \
         -L${KERNEL_ROOT_DIR}/lib/salome 
 
index 8c429887e8c990bc4053980740ef485ea3c55702..947604fb50dbee2a53beab774ac46ef102d48296 100644 (file)
@@ -36,6 +36,7 @@ using namespace std;
 #include "QAD_Application.h"
 #include "SUPERVGUI_Def.h"
 #include "QAD_RightFrame.h"
+#include "SALOME_Event.hxx"
 #include "SUPERVGraph_ViewFrame.h"
 #include <qlayout.h>
 #include <qfile.h>
@@ -1188,6 +1189,8 @@ void SUPERVGUI_Thread::KillThread(bool theValue)
   myMutex.unlock();
 }
 
+typedef TVoidMemFun2ArgEvent<SUPERVGUI_Main, char*, SUPERV::GraphState> TNodeSyncEvent;
+
 void SUPERVGUI_Thread::run()
 {
   SUPERV_CNode aNode = NULL;
@@ -1290,13 +1293,9 @@ void SUPERVGUI_Thread::run()
       //if list not empty call execute() -> sync()
       char * aNodeName = *(myMain->getEventNodes().getFirst());
       SUPERV::GraphState aNodeState = *(myMain->getStates().getFirst());
-      if (!qApp->locked()) {
-       qApp->lock();
-       myMain->execute(aNodeName,aNodeState);  //this is from main
-       qApp->unlock();
-      }
-      else 
-       myMain->execute(aNodeName,aNodeState);  //this is from main
+
+      // It is PROHIBITED to deal with widgets in a secondary thread, so event posting is used here
+      ProcessVoidEvent( new TNodeSyncEvent( myMain, &SUPERVGUI_Main::execute, aNodeName, aNodeState ) );
 
       myMain->removeFirstEN();
       myMain->removeFirstS();