Here's something to start with:
int key = event->key();
int modifiers = event->modifiers();
if (key >= Qt::Key_Shift && key <= Qt::Key_Alt)
key = 0;
qDebug
() <<
QKeySequence(modifiers ? modifiers
: key, modifiers ? key
: 0).
toString().
remove(", ");
int key = event->key();
int modifiers = event->modifiers();
if (key >= Qt::Key_Shift && key <= Qt::Key_Alt)
key = 0;
qDebug() << QKeySequence(modifiers ? modifiers : key, modifiers ? key : 0).toString().remove(", ");
To copy to clipboard, switch view to plain text mode
Bookmarks