1 /** Some generally useful Qt utils. */
9 * Watches for FocusIn and FocusOut events on a target widget.
10 * To use this class, create an instance (may be shared),
11 * connect to the signals, and attach the object to the widgets
12 * to be observed using:
13 * widgetInstance->installEventFilter(focusObserverInstance);
15 class FocusObserver
: public QObject
21 virtual ~FocusObserver() { }
24 // called when target widget receives focus
25 void focusIn(QWidget
*widget
);
27 // called when target widget loses focus
28 void focusOut(QWidget
*widget
);
31 virtual bool eventFilter(QObject
*obj
, QEvent
*event
);