ChasW
26th January 2007, 07:35
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
This doesnt:
(void) new QShortcut(Qt::Key_Shift + Qt::Key_C, this, SLOT(clear())); // clear
I also tried this, but it does not work either.
(void) new QShortcut(QKeySequence(Qt::Key_Shift + Qt::Key_C), this, SLOT(clear())); // clear
Do i need to override keyPressEvent or is QShortcut capable of handling Shift+C some other way?
Thanks in advance.
This works:
(void) new QShortcut(Qt::Key_F5, this, SLOT(refresh())); // refresh
This doesnt:
(void) new QShortcut(Qt::Key_Shift + Qt::Key_C, this, SLOT(clear())); // clear
I also tried this, but it does not work either.
(void) new QShortcut(QKeySequence(Qt::Key_Shift + Qt::Key_C), this, SLOT(clear())); // clear
Do i need to override keyPressEvent or is QShortcut capable of handling Shift+C some other way?
Thanks in advance.