Hi guys, I`ve reading the documentation with no luck...
I have a MainWindow with a menuBar and only one QToolButton that closes the mainWindow (as a result the application)..The thing is that when the spacebar is pressed within the mainWindow context, as the close button is the only one there, it triggers closing the application. So far I have this code but it seems that it is not intercepting the signal of the spacebar:
void MainWindow
::keyPressEvent (QKeyEvent *event
){ event->ignore ();
}
else{
event->accept ();
}
}
void MainWindow::keyPressEvent (QKeyEvent *event){
if (event == new QKeyEvent (QEvent::KeyPress, 20,0)){
event->ignore ();
}
else{
event->accept ();
}
}
To copy to clipboard, switch view to plain text mode
Thanks in advance!
Bookmarks