Created
April 1, 2012 15:03
-
-
Save 01walid/2276009 to your computer and use it in GitHub Desktop.
[Qt] Window got active or Focus event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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