Repository navigation
Fix Backspace in embedded widgets and the selection after undo of a delete - #564
Merged
Merged
Conversation
GraphicsView handled Backspace (on macOS) and Delete before the scene saw the key. A focused line edit in a node lost the key and the selected nodes were deleted instead. Fixes #562
Undo of a delete selected every restored node and connection. The restore function is shared with paste, where this is wanted. Before the delete, selecting a node did not select its connections. Select only the nodes in the undo. Fixes #563
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.
Type of change
Description
Two small bugs in the undo and key handling of the graphics layer.
Give Backspace and Delete to a focused embedded widget first.GraphicsView::keyPressEventhandled Delete, and Backspace on macOS, before the scene saw the key. A focused line edit in a node lost the key, and the selected nodes were deleted instead. The view now passes the key on when the scene focus item is an embedded widget. The guard covers every key of the switch, so F2 (rename the label) does not fire while an embedded widget has the focus. Clicking into a field still does not select its node. That is unchanged.Do not select the connections restored by the undo of a delete. The undo of a delete selected every restored node and connection. The restore function is shared with paste, where this is wanted.insertSerializedItems()has a new flag,selectConnections. Paste passestrue. The undo of a delete passesfalse, so the restored nodes are selected, as they were before the delete, and their connections are not. A connection that was selected explicitly before the delete also comes back unselected.Each commit builds and passes on its own. Each has its test.
Testing
Breaking changes?
No.
Related issue
Fixes #562
Fixes #563