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

Skip to content

Commit eb5c74b

Browse files
committed
Qt5: Replace QStatusBar.showMessage with QLabel.setText for displaying messages
1 parent 5d9245d commit eb5c74b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,10 @@ def __init__(self, canvas, num):
471471
else:
472472
tbs_height = 0
473473

474+
# add text label to status bar
475+
self.statusbar_label = QtWidgets.QLabel()
476+
self.window.statusBar().addWidget(self.statusbar_label)
477+
474478
# resize the main window so it will display the canvas with the
475479
# requested size:
476480
cs = canvas.sizeHint()
@@ -493,8 +497,7 @@ def notify_axes_change(fig):
493497

494498
@QtCore.Slot()
495499
def _show_message(self, s):
496-
# Fixes a PySide segfault.
497-
self.window.statusBar().showMessage(s)
500+
self.statusbar_label.setText(s)
498501

499502
def full_screen_toggle(self):
500503
if self.window.isFullScreen():

0 commit comments

Comments
 (0)