2 #include "SalomeApp_EventFilter.h"
3 #include <SALOME_Event.hxx>
5 #include <qapplication.h>
7 SalomeApp_EventFilter* SalomeApp_EventFilter::myFilter = NULL;
10 SalomeApp_EventFilter::SalomeApp_EventFilter()
13 /* VSR 13/01/03 : installing global event filter for the application */
14 qApp->installEventFilter( this );
18 SalomeApp_EventFilter::~SalomeApp_EventFilter()
20 qApp->removeEventFilter( this );
23 bool SalomeApp_EventFilter::eventFilter( QObject* o, QEvent* e )
25 if ( e->type() == SALOME_EVENT )
27 SALOME_Event* aSE = (SALOME_Event*)((QCustomEvent*)e)->data();
29 ((QCustomEvent*)e)->setData( 0 );
32 return QObject::eventFilter( o, e );
36 void SalomeApp_EventFilter::processEvent( SALOME_Event* theEvent )
40 // Signal the calling thread that the event has been processed
41 theEvent->processed();
45 /*!Create new instance of SalomeApp_EventFilter*/
46 void SalomeApp_EventFilter::Init()
49 myFilter = new SalomeApp_EventFilter();
53 void SalomeApp_EventFilter::Destroy()