Generally you would use QAction
class for this, so you would have a QMenu
to which you will add actions, in your case CLOSE
. Then you can use SetShortcut
to add "CTRL + Q"
in menu.
pNewAction->setShortcut(QString(strAccel.c_str()));
where pNewAction
is of type QAction
.