Salome HOME
Models for object browser created
[modules/shaper.git] / src / PyEvent / PyEvent_EventFilter.h
1
2 #ifndef PyEvent_EVENTFILTER_H
3 #define PyEvent_EVENTFILTER_H
4
5 #include "PyEvent.h"
6 #include <QObject>
7
8 #if defined WIN32
9 #pragma warning( disable: 4251 )
10 #endif
11
12 class PyEvent_Event;
13
14 /*!
15   Event filter class for QApplication object that handles custom events posted by PyEvent_Event objects.
16   It assumes that such custom events are alwys posted, not sent. 
17   This event filter can be installed by any application that intends to use PyEvent_Event mechanism asynchronously.
18   This class replaced SalomeApp_EventFilter.
19 */
20 //PYEVENT_EXPORT
21 class PyEvent_EventFilter: public QObject 
22 {
23 public:
24   static void Init();
25   static void Destroy();
26
27 protected:
28   PyEvent_EventFilter();
29   virtual ~PyEvent_EventFilter();
30
31 private:
32   /*! global event filter for qapplication */
33   virtual bool eventFilter( QObject* o, QEvent* e );
34   void processEvent( PyEvent_Event* );
35
36 private:
37   static PyEvent_EventFilter* myFilter;
38 };
39
40 #if defined WIN32
41 #pragma warning( default: 4251 )
42 #endif
43
44 #endif