make keyboard pressed exec ur wish


/ Published in: C++
Save to your folder(s)



Copy this code and paste it in your HTML
  1. void MainWindow::keyPressEvent(QKeyEvent *event)
  2. {
  3.  
  4. switch (event->key())
  5. {
  6. //when keyboard "R" button is pressed
  7. case Qt::Key_R:
  8. //do this
  9. ui->pushButton->hide();
  10. break;
  11. }
  12. }

Report this snippet


Comments


You need to login to view comments.