Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f533687

Browse files
authored
Merge pull request #27215 from bersbersbers/fix-27214
Add `@QtCore.Slot()` decorations to `NavigationToolbar2QT`
2 parents 3180c94 + 40c6756 commit f533687

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/backends/backend_qt.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,13 @@ def __init__(self, canvas, parent=None, coordinates=True):
682682
if text is None:
683683
self.addSeparator()
684684
else:
685+
slot = getattr(self, callback)
686+
# https://bugreports.qt.io/browse/PYSIDE-2512
687+
slot = functools.wraps(slot)(functools.partial(slot))
688+
slot = QtCore.Slot()(slot)
689+
685690
a = self.addAction(self._icon(image_file + '.png'),
686-
text, getattr(self, callback))
691+
text, slot)
687692
self._actions[callback] = a
688693
if callback in ['zoom', 'pan']:
689694
a.setCheckable(True)

0 commit comments

Comments
 (0)