Skip to content

Commit f226149

Browse files
committed
Merge pull request matplotlib#2629 from efiring/qt4agg_remove_unneeded
backend_qt4agg: remove redundant classes. Closes matplotlib#1151.
2 parents b6a0c7e + b1ee8b2 commit f226149

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

lib/matplotlib/backends/backend_qt4.py

-3
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,6 @@ def configure_subplots(self):
683683
dia.setWindowIcon(QtGui.QIcon(image))
684684
dia.exec_()
685685

686-
def _get_canvas(self, fig):
687-
return FigureCanvasQT(fig)
688-
689686
def save_figure(self, *args):
690687
filetypes = self.canvas.get_supported_filetypes_grouped()
691688
sorted_filetypes = list(six.iteritems(filetypes))

lib/matplotlib/backends/backend_qt4agg.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,6 @@ def new_figure_manager_given_figure(num, figure):
5151
return FigureManagerQT(canvas, num)
5252

5353

54-
class NavigationToolbar2QTAgg(NavigationToolbar2QT):
55-
def _get_canvas(self, fig):
56-
return FigureCanvasQTAgg(fig)
57-
58-
59-
class FigureManagerQTAgg(FigureManagerQT):
60-
def _get_toolbar(self, canvas, parent):
61-
# must be inited after the window, drawingArea and figure
62-
# attrs are set
63-
if matplotlib.rcParams['toolbar'] == 'toolbar2':
64-
toolbar = NavigationToolbar2QTAgg(canvas, parent)
65-
else:
66-
toolbar = None
67-
return toolbar
68-
69-
7054
class FigureCanvasQTAgg(FigureCanvasQT, FigureCanvasAgg):
7155
"""
7256
The canvas the figure renders into. Calls the draw and print fig
@@ -183,5 +167,6 @@ def print_figure(self, *args, **kwargs):
183167
FigureCanvasAgg.print_figure(self, *args, **kwargs)
184168
self.draw()
185169

170+
186171
FigureCanvas = FigureCanvasQTAgg
187-
FigureManager = FigureManagerQTAgg
172+
FigureManager = FigureManagerQT

0 commit comments

Comments
 (0)