Use keyPressEvent rather than shortcut for polyline delete segment #1892
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1861 Introduced the ability to delete segments of an active polyline with a shortcut (the backspace key by default). This prevented the keypress event from being received by ScribbleArea::keyPressEvent, which in turn broke the delete selection action. This PR reverts the creation of the new shortcut, and uses PolylineTool::keyPressEvent instead to trigger this behavior. This allows for both the polyline tool and selection to use the backspace shortcuts. I also think this is a better way to do things code-wise.
However, it does mean that the polyline delete segment action is another one of shortcuts which is currently hardcoded. I do think it was a nice idea to have this as a customizable shortcut, but I think window-level shortcuts were the wrong way to go about this, or at the very least, all shortcuts would have to be handled this way to prevent some from getting overridden the delete selection action was.