I have looked and looked at this. The only way that I can find to really do this properly is to know the keyboard layout being used so that we know if the key()/text() generated requires the SHIFT key or not.
For the US this is easy as the following holds true for both the QWERTY and DVORAK keyboards:
Code:
shift: ! @ # $ % ^ & * ( ) _ + { } | : " < > ? ~
key: 1 2 3 4 5 6 7 8 9 0 - = [ ] \ ; ' , . / `
and seems to be the norm BUT for international keyboard layouts, this is simply not true!
So there really is no way to tell when shift is pressed and a key() of '!' is returned (which violates the Qt docs since it should ignore modifiers on US style keyboard layout) and text() returns '1' (which again violates the Qt docs since a '1' was NOT the generated unicode text) that it is okay to fix it without knowing the exact keyboard layout.
I did search for how to determine the keyboard layout being used in Qt but according to the search results this can not be done since it happens under the Qt layer.
So I think we will have to live with this mess (of needing to fix the ini file by hand) until Qt gets off its butt and actually fixes its code to do what the docs/api says it should do. If all platforms followed the api, then detecting if the shift would be at least theoretically possible.
But right now it is broken for Ctrl+Shift on Windows and broken for Meta+Shift on macOS. I have no other data for Linux as of yet other than it seems to handle Ctrl+Shift better than Windows.