8000 Merge pull request #5060 from tacaswell/fix_qt_draw_order · matplotlib/matplotlib@6b429c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b429c9

Browse files
committed
Merge pull request #5060 from tacaswell/fix_qt_draw_order
FIX: add check if the renderer exists
2 parents c27970c + 16baab9 commit 6b429c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def paintEvent(self, e):
7575
In Qt, all drawing should be done inside of here when a widget is
7676
shown onscreen.
7777
"""
78-
# FigureCanvasQT.paintEvent(self, e)
78+
# if the canvas does not have a renderer, then give up and wait for
79+
# FigureCanvasAgg.draw(self) to be called
80+
if not hasattr(self, 'renderer'):
81+
return
82+
7983
if DEBUG:
8084
print('FigureCanvasQtAgg.paintEvent: ', self,
8185
self.get_width_height())

0 commit comments

Comments
 (0)
0