Salome HOME
Process multi-selection in pop-up menu
[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 class PYEVENT_EXPORT PyEvent_EventFilter: public QObject 
21 {
22 public:
23   static void Init();
24   static void Destroy();
25
26 protected:
27   PyEvent_EventFilter();
28   virtual ~PyEvent_EventFilter();
29
30 private:
31   /*! global event filter for qapplication */
32   virtual bool eventFilter( QObject* o, QEvent* e );
33   void processEvent( PyEvent_Event* );
34
35 private:
36   static PyEvent_EventFilter* myFilter;
37 };
38
39 #if defined WIN32
40 #pragma warning( default: 4251 )
41 #endif
42
43 #endif