Qt Code:
  1. void Widget::keyPressEvent(QKeyEvent *qv)
  2. {
  3. qDebug() << qv->key();
  4.  
  5. //try calling your base class (from which you inherit Widget) key press event if you inherit widget from QWidget
  6. QWidget::keyPressEvent(qv);
  7.  
  8. }
To copy to clipboard, switch view to plain text mode