PDA

View Full Version : Alt+F4 isnt grabbed by QWidget::grabKeyboard()



BlackHornet
19th May 2009, 08:18
Alt+F4 directly calls a CloseEvent instead of being grabbed. This cause a big problem for our App, because we want to reassign Alt+F4 for a different action (not a QAction) in our older Fortran code.

Maybe someone has an idea how to solve this problem

Greets
Sebastian

talk2amulya
19th May 2009, 10:19
Alt+F4 is never sent to the widget but is directly sent to the Windows OS. look into qkeymapper_win.cpp, function
bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool grab);
see from where its called and how you can override this behaviour