Skip to content

Commit

Permalink
Merge pull request matplotlib#5060 from tacaswell/fix_qt_draw_order
Browse files Browse the repository at this point in the history
FIX: add check if the renderer exists
  • Loading branch information
efiring committed Sep 14, 2015
2 parents c27970c + 16baab9 commit 6b429c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def paintEvent(self, e):
In Qt, all drawing should be done inside of here when a widget is
shown onscreen.
"""
# FigureCanvasQT.paintEvent(self, e)
# if the canvas does not have a renderer, then give up and wait for
# FigureCanvasAgg.draw(self) to be called
if not hasattr(self, 'renderer'):
return

if DEBUG:
print('FigureCanvasQtAgg.paintEvent: ', self,
self.get_width_height())
Expand Down

0 comments on commit 6b429c9

Please sign in to comment.