Salome HOME
merge from master
[tools/sat_salome.git] / products / patches / matplotlib-1.4.3_fix_Cannot_connect_NavigationToolbar2QT.patch
1 diff -rupN ./lib/matplotlib/backends/backend_qt5.py_old ./lib/matplotlib/backends/backend_qt5.py
2 --- ./lib/matplotlib/backends/backend_qt5.py_old        2017-12-13 08:34:28.995053982 +0100
3 +++ ./lib/matplotlib/backends/backend_qt5.py    2017-12-13 08:34:58.674133153 +0100
4 @@ -475,10 +475,16 @@ class FigureManagerQT(FigureManagerBase)
5  
6          self.window._destroying = False
7  
8 +        # add text label to status bar
9 +        # fix https://github.com/matplotlib/matplotlib/issues/6858/ as 'matplotlib 2.0.2'
10 +        self.statusbar_label = QtWidgets.QLabel()
11 +        self.window.statusBar().addWidget(self.statusbar_label)
12 +
13          self.toolbar = self._get_toolbar(self.canvas, self.window)
14          if self.toolbar is not None:
15              self.window.addToolBar(self.toolbar)
16 -            self.toolbar.message.connect(self._show_message)
17 +            # fix https://github.com/matplotlib/matplotlib/issues/6858/ as 'matplotlib 2.0.2'
18 +            self.toolbar.message.connect(self.statusbar_label.setText)
19              tbs_height = self.toolbar.sizeHint().height()
20          else:
21              tbs_height = 0
22 @@ -502,10 +508,6 @@ class FigureManagerQT(FigureManagerBase)
23                  self.toolbar.update()
24          self.canvas.figure.add_axobserver(notify_axes_change)
25  
26 -    @QtCore.Slot()
27 -    def _show_message(self, s):
28 -        # Fixes a PySide segfault.
29 -        self.window.statusBar().showMessage(s)
30  
31      def full_screen_toggle(self):
32          if self.window.isFullScreen():
33