Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ShortcutOverride handler for Backspaces, fixing plot delete #313

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

ChrisYx511
Copy link
Contributor

@ChrisYx511 ChrisYx511 commented Nov 2, 2024

Description

Added a QEvent.ShortcutOverride catch to the utils.py event filter such that as when clicked into a pyqtgraph plot item, the backspace key throws a ShortcutOverride rather than a standard KeyEvent. This allows deleting plot items and any other items depending on pyqtgraph properly.

Changed EventTracker eventfilter() function to also catch and handle QEvent.ShortcutOverride types if and only if the key pressed is also Qt.Backspace_Key in order to fix the above issue while not causing any unintended side-effects or breaking any default keyboard shortcuts.

This PR closes #306 .

Developer Testing

Test all existing keyboard shortcuts with this change and make sure they still work.

  • Pressing backspace in a graph works in all conditions, wherever i click on the plot item (outer box, inner plot, edges)
  • Press all other keys and make sure they still do their intended functions.

Reviewer Testing

Here's what you should do to quickly validate my changes:

  • press some keys
  • make sure the plot item deletes no matter where they're clicked or focused

This change is Reviewable

@zangjiucheng zangjiucheng force-pushed the c424yang/306-delete-charts branch from db6278e to 9016913 Compare November 2, 2024 19:58
Copy link
Member

@zangjiucheng zangjiucheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @BigLiban, @Darth-Raazi, @Lucifersan, @patrick-gu, and @saads312)

@zangjiucheng zangjiucheng merged commit ff4fc12 into master Nov 2, 2024
2 checks passed
@zangjiucheng zangjiucheng deleted the c424yang/306-delete-charts branch November 2, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sinks/dashboard] Locked Charts Cannot be Deleted Once Unlocked
2 participants