I am trying to create a shortcut that uses a multi-key combination for a widget.
This works:
(void) new QShortcut(Qt
::Key_F5,
this,
SLOT(refresh
()));
// refresh
(void) new QShortcut(Qt::Key_F5, this, SLOT(refresh())); // refresh
To copy to clipboard, switch view to plain text mode
This doesnt:
(void) new QShortcut(Qt
::Key_Shift + Qt
::Key_C,
this,
SLOT(clear
()));
// clear
(void) new QShortcut(Qt::Key_Shift + Qt::Key_C, this, SLOT(clear())); // clear
To copy to clipboard, switch view to plain text mode
I also tried this, but it does not work either.
(void) new QShortcut(QKeySequence(Qt::Key_Shift + Qt::Key_C), this, SLOT(clear())); // clear
To copy to clipboard, switch view to plain text mode
Do i need to override keyPressEvent or is QShortcut capable of handling Shift+C some other way?
Thanks in advance.
Bookmarks