Skip to content

silx.gui.plot.PlotWidget: Fixed matplotlib backend wheel support - #4686

Merged
loichuder merged 1 commit into
mainfrom
fix-matpolib-backend-wheel-event
Aug 4, 2026
Merged

silx.gui.plot.PlotWidget: Fixed matplotlib backend wheel support#4686
loichuder merged 1 commit into
mainfrom
fix-matpolib-backend-wheel-event

Conversation

@t20100

@t20100 t20100 commented Aug 1, 2026

Copy link
Copy Markdown
Member

PR summary

This PR fixes issues with the use of QWheelEvent event in the matplotlib backend with the different Qt bindings (see comments).

To reproduce: QT_API=PyQt6 ipython -> from silx import sx, config; w = sx.plot([1, 2, 3], backend="mpl")
and zoom in/out with the trackpad (or need to fall in the specific condition if event.angleDelta().y() == 0:)

Bug introduced in #4631

AI Disclosure

  • No AI used

@t20100 t20100 added this to the Next release milestone Aug 1, 2026
@t20100
t20100 requested review from loichuder and payno August 1, 2026 16:30
event.modifiers(),
event.phase(),
event.inverted(),
qt.Qt.MouseEventSynthesizedByApplication,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

event.modifiers(),
event.phase(),
event.inverted(),
qt.Qt.MouseEventSynthesizedByApplication,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

event.source() is obsolete in Qt6: https://doc.qt.io/qt-6/qmouseevent-obsolete.html#source, and so not available through PyQt6.
Though it works with PyQt5 and PySide6, I decided to do the same for all bindings (TBH I doubt it is ever retrieved).

event.buttons(),
event.modifiers(),
event.phase(),
event.isInverted(),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Typo here, there is no isInverted, it's inverted https://doc.qt.io/qt-6/qwheelevent.html#inverted-prop

@loichuder
loichuder merged commit 6942519 into main Aug 4, 2026
3 of 4 checks passed
@loichuder
loichuder deleted the fix-matpolib-backend-wheel-event branch August 4, 2026 07: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.

3 participants