Skip to content

Commit 6ab5475

Browse files
committed
Merge pull request #6854 from anntzer/pyqt57-fix
Fix: bad slot signature for Qt closes #6853
1 parent aaeaffd commit 6ab5475

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -460,18 +460,18 @@ def __init__(self, canvas, num):
460460

461461
self.window._destroying = False
462462

463+
# add text label to status bar
464+
self.statusbar_label = QtWidgets.QLabel()
465+
self.window.statusBar().addWidget(self.statusbar_label)
466+
463467
self.toolbar = self._get_toolbar(self.canvas, self.window)
464468
if self.toolbar is not None:
465469
self.window.addToolBar(self.toolbar)
466-
self.toolbar.message.connect(self._show_message)
470+
self.toolbar.message.connect(self.statusbar_label.setText)
467471
tbs_height = self.toolbar.sizeHint().height()
468472
else:
469473
tbs_height = 0
470474

471-
# add text label to status bar
472-
self.statusbar_label = QtWidgets.QLabel()
473-
self.window.statusBar().addWidget(self.statusbar_label)
474-
475475
# resize the main window so it will display the canvas with the
476476
# requested size:
477477
cs = canvas.sizeHint()
@@ -493,10 +493,6 @@ def notify_axes_change(fig):
493493
self.canvas.figure.add_axobserver(notify_axes_change)
494494
self.window.raise_()
495495

496-
@QtCore.Slot()
497-
def _show_message(self, s):
498-
self.statusbar_label.setText(s)
499-
500496
def full_screen_toggle(self):
501497
if self.window.isFullScreen():
502498
self.window.showNormal()

0 commit comments

Comments
 (0)