I have a problem about capturing QKeyEvent in a QOpenGLWidget when I use it as a... widget. It works perfectly well if I use my QOpenGLWidget as a main window but not if the widget is the child of another mainWindow... (Nothing happen)
Maybe I messed up something about how Qt widgets works but I can't figure it out.
I guess either your mainWindow treat the QKeyEvent (maybe it's an already mapped key combination) or prevents the forwarding to your custom widget component. Either when used as "QWidget", special rules are applied and you need to override some others handlers to make your handler able to take place.