|
9 | 9 | from matplotlib.backend_bases import ( |
10 | 10 | _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, |
11 | 11 | TimerBase, cursors, ToolContainerBase, MouseButton, |
12 | | - CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent) |
| 12 | + CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent, HoverEvent) |
13 | 13 | import matplotlib.backends.qt_editor.figureoptions as figureoptions |
14 | 14 | from . import qt_compat |
15 | 15 | from .qt_compat import ( |
@@ -305,6 +305,17 @@ def mouseReleaseEvent(self, event): |
305 | 305 | modifiers=self._mpl_modifiers(), |
306 | 306 | guiEvent=event)._process() |
307 | 307 |
|
| 308 | + def mouseOverEvent(self, event): |
| 309 | + artist = event.artist |
| 310 | + if not artist.get_hover: |
| 311 | + thismouse = MouseEvent("motion_notify_event", self, |
| 312 | + *self.mouseEventCoords(event), |
| 313 | + modifiers=self._mpl_modifiers(), |
| 314 | + guiEvent=event) |
| 315 | + hovering = HoverEvent("motion_notify_event", self, |
| 316 | + thismouse, artist, None) |
| 317 | + hovering._process() |
| 318 | + |
308 | 319 | def wheelEvent(self, event): |
309 | 320 | # from QWheelEvent::pixelDelta doc: pixelDelta is sometimes not |
310 | 321 | # provided (`isNull()`) and is unreliable on X11 ("xcb"). |
|
0 commit comments