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

Skip to content

Commit 8b81c13

Browse files
authored
Add @QtCore.Slot() decorations
1 parent 3ecb148 commit 8b81c13

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
@@ -642,8 +642,13 @@ def __init__(self, canvas, parent=None, coordinates=True):
642642
if text is None:
643643
self.addSeparator()
644644
else:
645+
slot = getattr(self, callback)
646+
# https://bugreports.qt.io/browse/PYSIDE-2512
647+
slot = lambda slot=slot, *args: slot(*args)
648+
slot = QtCore.Slot()(slot)
649+
645650
a = self.addAction(self._icon(image_file + '.png'),
646-
text, getattr(self, callback))
651+
text, slot)
647652
self._actions[callback] = a
648653
if callback in ['zoom', 'pan']:
649654
a.setCheckable(True)

0 commit comments

Comments
 (0)