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

Skip to content

Commit b80563f

Browse files
authored
Merge pull request #6854 from anntzer/pyqt57-fix
Fix: bad slot signature for Qt closes #6853
2 parents 83c67f2 + 655c513 commit b80563f

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
@@ -474,18 +474,18 @@ def __init__(self, canvas, num):
474474

475475
self.window._destroying = False
476476

477+
# add text label to status bar
478+
self.statusbar_label = QtWidgets.QLabel()
479+
self.window.statusBar().addWidget(self.statusbar_label)
480+
477481
self.toolbar = self._get_toolbar(self.canvas, self.window)
478482
if self.toolbar is not None:
479483
self.window.addToolBar(self.toolbar)
480-
self.toolbar.message.connect(self._show_message)
484+
self.toolbar.message.connect(self.statusbar_label.setText)
481485
tbs_height = self.toolbar.sizeHint().height()
482486
else:
483487
tbs_height = 0
484488

485-
# add text label to status bar
486-
self.statusbar_label = QtWidgets.QLabel()
487-
self.window.statusBar().addWidget(self.statusbar_label)
488-
489489
# resize the main window so it will display the canvas with the
490490
# requested size:
491491
cs = canvas.sizeHint()
@@ -507,10 +507,6 @@ def notify_axes_change(fig):
507507
self.canvas.figure.add_axobserver(notify_axes_change)
508508
self.window.raise_()
509509

510-
@QtCore.Slot()
511-
def _show_message(self, s):
512-
self.statusbar_label.setText(s)
513-
514510
def full_screen_toggle(self):
515511
if self.window.isFullScreen():
516512
self.window.showNormal()

0 commit comments

Comments
 (0)