How would one check if the SHIFT key is held and the TAB key is pressed with a QKeyEvent?
I've tried using:
(event->key() == Qt::Key_Tab && event->modifiers() == Qt::ShiftModifier)
However, the event->key()
is not equal to Qt::Key_Tab
whenever the shift key is held down.
If event->key()
is printed in hexadecimal format:
qDebug()<<QString("key: 0x%1").arg(event->key(), 8, 16, QChar('0'));
you get what: "key: 0x01000002"
then checking in the docs and you see that the key is:
Qt::Key_Backtab 0x01000002
So you have to use that key:
if(event->key() == Qt::Key_Backtab)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With