LDFLAGS += $(QT_MT_LIBS) $(VTK_LIBS) $(QWT_LIBS) -lSalomeNS -lTOOLSDS \
-lSalomeContainer -lOpUtil -lSalomeGUI -lVTKViewer -lSalomeHDFPersist \
- -lVisuConvertor -lVisuPipeLine -lVisuObject -lSalomeGenericObj \
+ -lVisuConvertor -lVisuPipeLine -lVisuObject -lSalomeGenericObj -lEvent \
-L${KERNEL_ROOT_DIR}/lib/salome
LIBS+= $(PYTHON_LIBS) $(MED2_LIBS) $(HDF5_LIBS) -lPlot2d \
#include <qfileinfo.h>
#include "SALOME_Event.hxx"
-#include <qwaitcondition.h>
-#define EVENT_TIMEOUT 300000
using namespace std;
/*! SAN & VSR : Test QT_EVENT
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
+ #define TEST_EVENT 1
void VISU_Gen_i::DoSomething() {
- static int myCounter = 0;
- MESSAGE("VISU_Gen_i::DoSomething : "<<myMutex);
+ MESSAGE("VISU_Gen_i::DoSomething : myMutex = "<<myMutex);
if(myMutex){
- QWaitCondition wc;
- QApplication::postEvent( qApp, new SALOME_Event( &wc ) );
- if ( ! wc.wait( EVENT_TIMEOUT ) ) {
- INFOS( "VISU_Gen_i::DoSomething ERROR ! VISU_Gen is used from GUI." );
- }
- MESSAGE( "VISU_Gen_i::DoSomething : myCounter = " << ++myCounter );
+ MESSAGE( "VISU_Gen_i::DoSomething started" );
+ SALOME_Semaphore s;
+ QThread::postEvent( qApp, new SALOME_Event( TEST_EVENT, &s ) );
+ s += 1;
+ MESSAGE( "VISU_Gen_i::DoSomething completed" );
return;
}
myVisuGen->DoSomething();