Run the attached test and you'll see this output:
Then make the following changes
and click the shift key once before the test finishes, and you'll see this output:
This difference (along with the fact that shift event handling/behaviour doesn't seem to be documented) makes it impossible to test shift events in an application: if I handle modifiers one way, the test will fail, and if I do it the other way, the actual application won't work as expected.
The only documentation I can find is https://doc.qt.io/qt-5/qkeyevent.html#modifiers, and it says:
Returns the keyboard modifier flags that existed immediately after the event occurred.
So is Qt Test wrong?