lgos
29th July 2014, 22:27
Hi,
The title says it all. I want to do something evverytime my window is minimized, or put to background, everytime I switch to other window.
I thought it had to do with losing focus so I tried :
bool Note::eventFilter(QObject *object, QEvent *event)
{
if( event->type() == QEvent::FocusOut )
{
Note::writeToFile();
return true;
}
return false;
}
with
installEventFilter(this); on the cosntructor.
But it didn't work. It works with QEvent::KeyPress however.
The title says it all. I want to do something evverytime my window is minimized, or put to background, everytime I switch to other window.
I thought it had to do with losing focus so I tried :
bool Note::eventFilter(QObject *object, QEvent *event)
{
if( event->type() == QEvent::FocusOut )
{
Note::writeToFile();
return true;
}
return false;
}
with
installEventFilter(this); on the cosntructor.
But it didn't work. It works with QEvent::KeyPress however.