From eb5c74b2fd00a477fd9f4d22d9ea9eb210cfb147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20W=C3=BCrtz?= Date: Mon, 10 Aug 2015 14:55:48 +0200 Subject: [PATCH] Qt5: Replace QStatusBar.showMessage with QLabel.setText for displaying messages --- lib/matplotlib/backends/backend_qt5.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index c3e9d71ccfca..b92f545772bf 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -471,6 +471,10 @@ def __init__(self, canvas, num): else: tbs_height = 0 + # add text label to status bar + self.statusbar_label = QtWidgets.QLabel() + self.window.statusBar().addWidget(self.statusbar_label) + # resize the main window so it will display the canvas with the # requested size: cs = canvas.sizeHint() @@ -493,8 +497,7 @@ def notify_axes_change(fig): @QtCore.Slot() def _show_message(self, s): - # Fixes a PySide segfault. - self.window.statusBar().showMessage(s) + self.statusbar_label.setText(s) def full_screen_toggle(self): if self.window.isFullScreen():