2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
5 * A Qt object that invokes its callback whenever it receives
6 * an event. This is useful for deferring processing to the
7 * Qt event loop. Use it to avoid problems resulting from the
8 * non-reentrant nature of WvStream::execute().
18 // parameters are: WvQtHook &, int type, void *data
19 typedef wv::function
<void(WvQtHook
&, int, void*)> WvQtHookCallback
;
21 class WvQtHook
: public QObject
24 WvQtHookCallback callback
;
27 WvQtHook(WvQtHookCallback _callback
= NULL
);
29 // sets the callback function to be invoked
30 void setcallback(WvQtHookCallback _callback
);
32 // posts an event to the Qt event loop to be sent to the
33 // attached callback later
34 void post(int type
= 0, void *data
= NULL
);
36 // sends an event to the attached callback now
37 void send(int type
= 0, void *data
= NULL
);
40 virtual bool event(QEvent
*event
);
43 #endif // __WVQTHOOK_H