How to receive KeyEvents on a QWidget?
Solved
General and Desktop
-
I'm designing a QWidget that I'm manually drawing via the paintEvent(). I'd like to be able to receive keypress events on it. I have a second object derived from QObject that has installed an eventFilter on my QWidget and while it is receiving various events (such as windows and mouse events), it is not receiving any keypress events even after I click on it and press keys on my keyboard. Is there anything else I need to do to capture keyboard input?
-
Hi,
Check the QWidget::grabKeyboard and its friend QWidget::releaseKeyboard.