- Start MITK in debug-mode
- Press Ctrl+P or go to "Window -> Preference" to open the preference menu
- click on "DataManager -> Hotkeys"
- Experience a workbench crash in mitkBaseApplication. Output is:
The error seems to be in the QKeySequence.
Looks like Qt cannot handle the Ctrl+ sequence. Why is this only happening in debug mode?
However, even in release mode the Ctrl+-sequences do not work (e.g. try Ctrl+R for GlobalReinit).
The preference page does not show the Ctrl+-part of the sequence, but starts with a comma (e.g. , R). If the user changes a key sequence to a combination of Ctrl+letter, the sequence is recognized and shown as text in the line edit. If the user clicks on Ok and reopens the preference page, the Ctrl+-part is removed and the sequence starts with a comma again.
Apparently initializing a QKeySequence with QKeySequence(keyEvent->modifiers(), keyEvent->key()) does not work, since both arguments will be taken as individual integers, each representing a key. The first argument however is only a modifier and does not represent a real key - it can only be combined with a key. That's why the result is , Key, where the first key is not recognized.
Using QKeySequence(keyEvent->modifiers() + keyEvent->key()) solved this problem.