Implement Backspace key support for polygon/polyline creation#4372
Open
dhruv1955 wants to merge 1 commit intomapeditor:masterfrom
Open
Implement Backspace key support for polygon/polyline creation#4372dhruv1955 wants to merge 1 commit intomapeditor:masterfrom
dhruv1955 wants to merge 1 commit intomapeditor:masterfrom
Conversation
- Add Backspace key handling in CreatePolygonObjectTool::keyPressed() - Remove last placed point during polygon/polyline creation - Support both creating and extending modes - Update overlay polygon and handles appropriately - Cancel object when reduced to single point (minimum 2 points required) Fixes TODO comment about Backspace functionality for going back one step. Signed-off-by: dhruv1955 <dhruvyadav042905@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add Backspace key support to remove the last placed point during polygon
and polyline creation, without canceling the entire shape.
Problem
When drawing polygons or polylines, users had no way to undo just the last
placed point. The only option was Escape, which canceled the entire shape —
forcing a restart even for a single mis-click.
Solution
Handle Qt::Key_Backspace in keyPressed() when state() == CreatingObject:
Changes
Testing
Notes
Resolves the first TODO in keyPressed(). The second TODO
(Shift+Enter to finish as polygon) is left for a follow-up.