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
#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>
myMutex.unlock();
}
+typedef TVoidMemFun2ArgEvent<SUPERVGUI_Main, char*, SUPERV::GraphState> TNodeSyncEvent;
+
void SUPERVGUI_Thread::run()
{
SUPERV_CNode aNode = NULL;
//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();