What event am I looking for?
I want to run some code whenever a specific (non-floating) window in my application is activated. I also need this code to run whenever the user switches to my application (with this specific window on top). What event(s) or slot(s) am I looking for?
Re: What event am I looking for?
I'd think that QWidget::focusInEvent() and QWidget::focusOutEvent() would prove interesting. Think about checking the QFocusEvent::reason() to determine whether or not your code should be executed...
Re: What event am I looking for?
By the way, there is also QEvent::WindowActivate. Activating a window does not necessarily transfer focus to the corresponding window on all window systems / configurations.