Enable pyqtgraph 0.14 compatibility in crosshair interaction paths#1176
Open
Copilot wants to merge 4 commits into
Open
Enable pyqtgraph 0.14 compatibility in crosshair interaction paths#1176Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Copilot
AI
changed the title
[WIP] Make BW compatible with pyqtgraph 0.14
Enable pyqtgraph 0.14 compatibility in crosshair interaction paths
May 27, 2026
Contributor
Benchmark comparisonThreshold: 20% (lower is better). No benchmark regression exceeded the configured threshold. No benchmark improvement exceeded the configured threshold. All benchmark results
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates BEC Widgets to support pyqtgraph 0.14 by adapting crosshair mouse move/click handling to the newer event model and aligning unit tests with the updated interaction paths.
Changes:
- Relax
pyqtgraphdependency from a strict 0.13.7 pin to the 0.14.x line. - Update crosshair move/click bounds checks to use
ViewBox.viewRange()and click position retrieval viaevent.scenePos(). - Refactor crosshair tests to use deterministic
manual_posmovement and a synthetic click event usingscenePos().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
bec_widgets/utils/crosshair.py |
Switches bounds validation to viewRange() for move/click paths and uses scenePos() for click handling. |
tests/unit_tests/test_crosshair.py |
Updates movement tests to manual_pos, adds a synthetic click-event path, and adjusts 2D out-of-bounds expectations. |
pyproject.toml |
Relaxes pyqtgraph requirement to ~=0.14.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
66cf0a7 to
e747432
Compare
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.
Disclaimer
This PR was created by GitHub copilot remotely from the mobile app to see if there could be any reasonable usage of this feature. There were some minor things off (like checking boundaries of plot with crosshair, adjusted by me in the last commit). I kept the original commits (just change their commit message to respect conventional commits).
I tested locally with all plotting widgets and it seems to work (but the adjustments were mostly to tests anyway).
Text from here is made by copilot, I just scratched or removed parts which I fixed already.
Description
BEC Widgets was pinned to pyqtgraph 0.13.7 and had crosshair event assumptions that break under pyqtgraph 0.14. This change updates the dependency and adapts crosshair move/click handling and tests to the 0.14 event model.
Dependency update
==0.13.7to~=0.14.0.Crosshair runtime compatibility
viewRange().scenePos()(public API) and no longer depends on private event internals.Crosshair test alignment with 0.14 behavior
manual_posfor deterministic coverage.scenePos().Related Issues
Type of Change
pyqtgraph0.14 line)How to test
QT_QPA_PLATFORM=offscreen QTWEBENGINE_DISABLE_SANDBOX=1 pytest -q tests/unit_tests/test_crosshair.pyQT_QPA_PLATFORM=offscreen QTWEBENGINE_DISABLE_SANDBOX=1 pytest -q tests/unit_tests/test_plot_base_next_gen.py tests/unit_tests/test_waveform.py tests/unit_tests/test_image_view_next_gen.py tests/unit_tests/test_heatmap_widget.pyPotential side effects
Crosshair move/click emission is now gated by mappedviewRange()bounds; this may slightly change behavior near plot edges/zoom boundaries.For 2D items, out-of-range manual positions are treated via existing clamp-to-bounds behavior in snap logic.