Revision: 4178 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4178&view=rev Author: mdboom Date: 2007-11-09 05:10:12 -0800 (Fri, 09 Nov 2007)
Log Message: ----------- Avoid annoying Qt4 messages when mpl raises an exception. (Thanks to Martin Teichmann in patch 1828813) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:08:48 UTC (rev 4177) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:10:12 UTC (rev 4178) @@ -80,8 +80,6 @@ if DEBUG: print 'FigureCanvasQtAgg.paintEvent: ', self, \ self.get_width_height() - p = QtGui.QPainter( self ) - # only replot data when needed if type(self.replot) is bool: # might be a bbox for blitting if self.replot: @@ -99,6 +97,7 @@ qImage = QtGui.QImage(stringBuffer, self.renderer.width, self.renderer.height, QtGui.QImage.Format_ARGB32) + p = QtGui.QPainter(self) p.drawPixmap(QtCore.QPoint(0, 0), QtGui.QPixmap.fromImage(qImage)) # draw the zoom rectangle to the QPainter @@ -106,6 +105,7 @@ p.setPen( QtGui.QPen( QtCore.Qt.black, 1, QtCore.Qt.DotLine ) ) p.drawRect( self.rect[0], self.rect[1], self.rect[2], self.rect[3] ) + p.end() # we are blitting here else: bbox = self.replot @@ -114,10 +114,10 @@ reg = self.copy_from_bbox(bbox) stringBuffer = reg.to_string() qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32) + p = QtGui.QPainter(self) pixmap = QtGui.QPixmap.fromImage(qImage) p.drawPixmap(QtCore.QPoint(l, self.renderer.height-t), pixmap) - - p.end() + p.end() self.replot = False self.drawRect = False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins