I am writing to Qt and it became necessary to override the keyPressEvent function. I do it like this:
void glass::keyPressEvent(QKeyEvent *) { // тело функции } where glass is the class name. However, the application does not respond to keystrokes, but it is worth changing the class name to QWidget, as everything starts to work. What can be wrong?
Class declaration:
class glass : public QWidget { public: // Остальные функции protected: void keyPressEvent(QKeyEvent*); private: };