Skip to content

Commit 3d2872e

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

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/matplotlib/backends/backend_qt5.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -459,18 +459,18 @@ def __init__(self, canvas, num):
459459

460460
self.window._destroying = False
461461

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

470-
# add text label to status bar
471-
self.statusbar_label = QtWidgets.QLabel()
472-
self.window.statusBar().addWidget(self.statusbar_label)
473-
474474
# resize the main window so it will display the canvas with the
475475
# requested size:
476476
cs = canvas.sizeHint()
@@ -491,10 +491,6 @@ def notify_axes_change(fig):
491491
self.toolbar.update()
492492
self.canvas.figure.add_axobserver(notify_axes_change)
493493

494-
@QtCore.Slot()
495-
def _show_message(self, s):
496-
self.statusbar_label.setText(s)
497-
498494
def full_screen_toggle(self):
499495
if self.window.isFullScreen():
500496
self.window.showNormal()

0 commit comments

Comments
 (0)