Revision: 7250
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7250&view=rev
Author:   dsdale
Date:     2009-07-08 21:15:46 +0000 (Wed, 08 Jul 2009)

Log Message:
-----------
improve resizing behavior of qt4 backend

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
    trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2009-07-07 12:41:45 UTC (rev 7249)
+++ trunk/matplotlib/CHANGELOG  2009-07-08 21:15:46 UTC (rev 7250)
@@ -1,3 +1,7 @@
+2009-07-08 Attempt to improve performance of qt4 backend, do not call
+           qApp.processEvents while processing an event. Thanks Ole
+           Streicher for tracking this down - DSD
+
 2009-06-24 Add withheader option to mlab.rec2csv and changed
   use_mrecords default to False in mlab.csv2rec since this is
   partially broken - JDH
@@ -2,3 +6,2 @@
 
-
 2009-06-24 backend_agg.draw_marker quantizes the main path (as in the

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py     2009-07-07 
12:41:45 UTC (rev 7249)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py     2009-07-08 
21:15:46 UTC (rev 7250)
@@ -158,7 +158,6 @@
 
     def resizeEvent( self, event ):
         if DEBUG: print 'resize (%d x %d)' % (event.size().width(), 
event.size().height())
-        QtGui.QWidget.resizeEvent( self, event )
         w = event.size().width()
         h = event.size().height()
         if DEBUG: print "FigureCanvasQtAgg.resizeEvent(", w, ",", h, ")"
@@ -167,20 +166,9 @@
         hinch = h/dpival
         self.figure.set_size_inches( winch, hinch )
         self.draw()
+        self.update()
+        QtGui.QWidget.resizeEvent(self, event)
 
-    def resize( self, w, h ):
-        # Pass through to Qt to resize the widget.
-        QtGui.QWidget.resize( self, w, h )
-
-        # Resize the figure by converting pixels to inches.
-        pixelPerInch = self.figure.dpi
-        wInch = w / pixelPerInch
-        hInch = h / pixelPerInch
-        self.figure.set_size_inches( wInch, hInch )
-
-        # Redraw everything.
-        self.draw()
-
     def sizeHint( self ):
         w, h = self.get_width_height()
         return QtCore.QSize( w, h )

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py  2009-07-07 
12:41:45 UTC (rev 7249)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py  2009-07-08 
21:15:46 UTC (rev 7250)
@@ -61,9 +61,6 @@
         self.replot = True
         self.setAttribute(QtCore.Qt.WA_OpaquePaintEvent)
 
-    def resizeEvent( self, e ):
-        FigureCanvasQT.resizeEvent( self, e )
-
     def drawRectangle( self, rect ):
         self.rect = rect
         self.drawRect = True
@@ -132,8 +129,6 @@
         self.replot = True
         FigureCanvasAgg.draw(self)
         self.update()
-        # Added following line to improve realtime pan/zoom on windows:
-        QtGui.qApp.processEvents()
 
     def blit(self, bbox=None):
         """


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to