@@ -63,14 +63,15 @@ class FigureCanvasQTAggBase(object):
6363
6464 def drawRectangle (self , rect ):
6565 self ._drawRect = rect
66- self .repaint ()
66+ self .draw_idle ()
6767
6868 def paintEvent (self , e ):
6969 """
7070 Copy the image from the Agg canvas to the qt.drawable.
7171 In Qt, all drawing should be done inside of here when a widget is
7272 shown onscreen.
7373 """
74+ FigureCanvasAgg .draw (self )
7475
7576 # FigureCanvasQT.paintEvent(self, e)
7677 if DEBUG :
@@ -146,7 +147,7 @@ def draw(self):
146147 # causes problems with code that uses the result of the
147148 # draw() to update plot elements.
148149 FigureCanvasAgg .draw (self )
149- self ._priv_update ()
150+ self .update ()
150151
151152 def blit (self , bbox = None ):
152153 """
@@ -183,22 +184,6 @@ def __init__(self, figure):
183184 self ._drawRect = None
184185 self .blitbox = None
185186 self .setAttribute (QtCore .Qt .WA_OpaquePaintEvent )
186- # it has been reported that Qt is semi-broken in a windows
187- # environment. If `self.draw()` uses `update` to trigger a
188- # system-level window repaint (as is explicitly advised in the
189- # Qt documentation) the figure responds very slowly to mouse
190- # input. The work around is to directly use `repaint`
191- # (against the advice of the Qt documentation). The
192- # difference between `update` and repaint is that `update`
193- # schedules a `repaint` for the next time the system is idle,
194- # where as `repaint` repaints the window immediately. The
195- # risk is if `self.draw` gets called with in another `repaint`
196- # method there will be an infinite recursion. Thus, we only
197- # expose windows users to this risk.
198- if sys .platform .startswith ('win' ):
199- self ._priv_update = self .repaint
200- else :
201- self ._priv_update = self .update
202187
203188
204189FigureCanvas = FigureCanvasQTAgg
0 commit comments