E5Graphics/E5GraphicsView.py

branch
5_2_x
changeset 2029
51e8278f2c3d
parent 1509
c0b5e693b0eb
child 2303
0ed4ed026c16
--- a/E5Graphics/E5GraphicsView.py	Tue Sep 04 11:41:07 2012 +0200
+++ b/E5Graphics/E5GraphicsView.py	Sat Sep 08 18:28:46 2012 +0200
@@ -35,12 +35,7 @@
         self.setAlignment(Qt.Alignment(Qt.AlignLeft | Qt.AlignTop))
         self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
         self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
-        
-        # available as of Qt 4.3
-        try:
-            self.setViewportUpdateMode(QGraphicsView.SmartViewportUpdate)
-        except AttributeError:
-            pass
+        self.setViewportUpdateMode(QGraphicsView.SmartViewportUpdate)
         
         self.setWhatsThis(self.trUtf8("<b>Graphics View</b>\n"
             "<p>This graphics view is used to show a diagram. \n"
@@ -119,13 +114,13 @@
         """
         Public method to set the scene size.
         
-        @param width width for the scene (integer)
-        @param height height for the scene (integer)
+        @param width width for the scene (float)
+        @param height height for the scene (float)
         """
         rect = self.scene().sceneRect()
         rect.setHeight(height)
         rect.setWidth(width)
-        self.setSceneRect(rect)
+        self.scene().setSceneRect(rect)
         
     def _getDiagramRect(self, border=0):
         """

eric ide

mercurial