Hello,

I am overriding an eventFilter, and I am trying to catch both Shift and Control modifiers.
I am unfortunately unable to get the work together.

I tried both

Qt Code:
  1. QKeyEvent *key_event = static_cast<QKeyEvent*>(event);
  2. if (key_event->modifiers() & (Qt::ShiftModifier | Qt::ControlModifier))
  3. {
  4. ...
  5. }
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. Qt::KeyboardModifiers keyMod = QApplication::keyboardModifiers ();
  2. bool isSHIFT = keyMod.testFlag(Qt::ShiftModifier);
  3. bool isCTRL = keyMod.testFlag(Qt::ControlModifier);
  4.  
  5. if (isSHIFT && isCTRL)
  6. {
  7. ...
  8. }
To copy to clipboard, switch view to plain text mode 

Does someone know how to do it?

Luca