Today I’m looking for the command to activate and deactivate the segment Editor shortcuts using Python code. The shortcuts sometimes works correctly and then, in the same conditions if I open again the segmentation they doesn’t work anymore.
Can I anybody explain me how this works, and if it’s possible to activate and deactivate it?
Management of shortcuts in Qt is quite complex and fragile. Most often shortcuts break when you are trying to assign a shortcut multiple times. Make sure that after calling installKeyboardShortcuts you always call uninstallKeyboardShortcuts.
After disabling the shortcut once, if I restart the application with the calls to this function removed( therefore no more “Ctrl+z” shortcut override), I am not able to use the shortcut for the segment editor. Like @SANTIAGO_PENDON_MING mentioned, the shortcut doesn’t work anymore. Would you happen to know why?
Found this in another post as well :-
So are you suggesting that I should not disable “Ctrl+z“ based on custom logic?