PDA

View Full Version : How to add a Hot Key to a Qt Project?



Bong.Da.City
6th September 2010, 21:07
I want when somebody press Ctrl+Q the application to close... So how can i do this?

I now the command
qApp->quit();

But i do not know how to add the hotkey..

codebehind
6th September 2010, 21:26
override the QWidget::keyPressEvent(QKeyEvent * event) of the widget you are using.