tuli
17th December 2012, 15:57
hi,
I have a QMainWindow hosting several subclassed QDockWidgets. I would now need to detect when one of the QDockWIdgets gets or looses focus.
There doesnt appear to be a signal for that, so i figured i have to catch the event somehow :
class mydockwid : public QDockWidget
{
Q_OBJECT
public:
....
//qt event handlers
virtual void focusInEvent( QFocusEvent* );
};
But the focusInEvent() never gets called. I am also worried that QDockWidget has or will have use for focusInEvent() itself, and i break its functionality.
How to do it properly?
I have a QMainWindow hosting several subclassed QDockWidgets. I would now need to detect when one of the QDockWIdgets gets or looses focus.
There doesnt appear to be a signal for that, so i figured i have to catch the event somehow :
class mydockwid : public QDockWidget
{
Q_OBJECT
public:
....
//qt event handlers
virtual void focusInEvent( QFocusEvent* );
};
But the focusInEvent() never gets called. I am also worried that QDockWidget has or will have use for focusInEvent() itself, and i break its functionality.
How to do it properly?