ChasW
2nd February 2007, 19:31
Is it possible to create a shortcut or connection from main() that quits the app using a keypress? i.e. not from within a widget
I realize qApp->quit() is the call I need, but Im not sure how to connect that to a keypress shortcut that doesnt come from a button click or other type of SIGNAL.
.. and when I do something like this:
(void) new QShortcut(Qt::Key_Escape, &app, (QApplication::quit()));
i get invalid use of void expression
Thank you,
ChasW
I realize qApp->quit() is the call I need, but Im not sure how to connect that to a keypress shortcut that doesnt come from a button click or other type of SIGNAL.
.. and when I do something like this:
(void) new QShortcut(Qt::Key_Escape, &app, (QApplication::quit()));
i get invalid use of void expression
Thank you,
ChasW