In my QMainWindow subclass, I have several QActions with QKeySequence shortcuts. I have also reimplemented QWidget::keyPressEvent
and QWidget::keyReleaseEvent
in the main window.
If I type one of the shortcuts on my keyboard (e.g., Ctrl + C), keyPressEvent
is not called in my main window, which makes sense because the relevant action wants that event instead. However, keyReleaseEvent
is called for some reason. Is there any way to prevent that, or at least easily detect in keyReleaseEvent
if the event matches one of the main window's shortcuts, so that I can ignore the event?
This seems to be a bug. I filed a report here.