I want to handle the QEvent::WindowDeactivate and for this I overload this function on my QMainWindow derieved class.
class MainWindow : public QMainWindow
....
bool event(QEvent * e);
....
bool MainWindow::event(QEvent *e)
{
if(e->type() == QEvent::WindowDeactivate){
//do smth
}
}
And after that, this event function starts to intercept all other events in my program. All buttons and widgets in this window stop reacting on mouse clicks and keyboard events are also intercepted. Is there a way to fix this?
I solved the problem: had to add
return QWidget::event(e);
at the end of event implementation. And after that - everything works fine.