Skip to content

Instantly share code, notes, and snippets.

@01walid
Created April 1, 2012 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 01walid/2276009 to your computer and use it in GitHub Desktop.
Save 01walid/2276009 to your computer and use it in GitHub Desktop.
[Qt] Window got active or Focus event
bool MainWindow::event(QEvent * e) // overloading event(QEvent*) method of QMainWindow
{
switch(e->type())
{
// ...
case QEvent::WindowActivate :
// gained focus
break ;
case QEvent::WindowDeactivate :
// lost focus
break ;
// ...
} ;
return QMainWindow::event(e) ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment