2 #include "SalomeApp_EventFilter.h"
3 #include <SALOME_Event.hxx>
5 #include <qapplication.h>
7 SalomeApp_EventFilter* SalomeApp_EventFilter::myFilter = NULL;
9 SalomeApp_EventFilter::SalomeApp_EventFilter()
12 /* VSR 13/01/03 : installing global event filter for the application */
13 qApp->installEventFilter( this );
16 SalomeApp_EventFilter::~SalomeApp_EventFilter()
18 qApp->removeEventFilter( this );
21 bool SalomeApp_EventFilter::eventFilter( QObject* o, QEvent* e )
23 if ( e->type() == SALOME_EVENT )
25 SALOME_Event* aSE = (SALOME_Event*)((QCustomEvent*)e)->data();
27 ((QCustomEvent*)e)->setData( 0 );
30 return QObject::eventFilter( o, e );
33 void SalomeApp_EventFilter::processEvent( SALOME_Event* theEvent )
37 // Signal the calling thread that the event has been processed
38 theEvent->processed();
42 void SalomeApp_EventFilter::Init()
45 myFilter = new SalomeApp_EventFilter();
48 void SalomeApp_EventFilter::Destroy()