Revision: 8294
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8294&view=rev
Author:   dsdale
Date:     2010-05-04 17:53:33 +0000 (Tue, 04 May 2010)

Log Message:
-----------
Improve backend_qt4 so it displays figures with the correct size

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

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2010-05-04 05:24:53 UTC (rev 8293)
+++ trunk/matplotlib/CHANGELOG  2010-05-04 17:53:33 UTC (rev 8294)
@@ -1,3 +1,6 @@
+2010-05-04 Improve backend_qt4 so it displays figures with the
+           correct size - DSD
+
 2010-04-20 Added generic support for connecting to a timer for events. This
            adds TimerBase, TimerGTK, TimerQT, TimerWx, and TimerTk to
            the backends and a new_timer() method to each backend's

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py     2010-05-04 
05:24:53 UTC (rev 8293)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py     2010-05-04 
17:53:33 UTC (rev 8294)
@@ -318,6 +318,13 @@
         QtCore.QObject.connect(self.toolbar, QtCore.SIGNAL("message"),
                 self.window.statusBar().showMessage)
 
+        # resize the main window so it will display the canvas with the
+        # requested size:
+        cs = canvas.sizeHint()
+        tbs = self.toolbar.sizeHint()
+        sbs = self.window.statusBar().sizeHint()
+        self.window.resize(cs.width(), cs.height()+tbs.height()+sbs.height())
+
         self.window.setCentralWidget(self.canvas)
 
         if matplotlib.is_interactive():


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

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to