26 #if ! defined (octave_GenericEventNotify_h)
27 #define octave_GenericEventNotify_h 1
38 class GenericEventNotifyReceiver;
75 if (
r->eventNotifyBefore (obj, evt))
86 r->eventNotifyAfter (obj, evt);
89 #define DECLARE_GENERICEVENTNOTIFY_SENDER(T,B) \
90 class T : public B, public GenericEventNotifySender \
93 T (QWidget *xparent) : B (xparent), GenericEventNotifySender () { } \
94 ~ T (void) = default; \
96 bool event (QEvent *evt) \
99 if (! notifyReceiversBefore (this, evt)) \
100 result = B::event (evt); \
101 notifyReceiversAfter (this, evt); \
virtual void eventNotifyAfter(QObject *obj, QEvent *evt)=0
virtual bool eventNotifyBefore(QObject *obj, QEvent *evt)=0
GenericEventNotifyReceiver(void)
virtual ~GenericEventNotifyReceiver(void)=default
void removeReceiver(GenericEventNotifyReceiver *r)
GenericEventNotifySender(void)
virtual ~GenericEventNotifySender(void)=default
void addReceiver(GenericEventNotifyReceiver *r)
QSet< GenericEventNotifyReceiver * > m_receivers
bool notifyReceiversBefore(QObject *obj, QEvent *evt)
void notifyReceiversAfter(QObject *obj, QEvent *evt)