E5Graphics/E5GraphicsView.py

changeset 5587
ea526b78ee6c
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
--- a/E5Graphics/E5GraphicsView.py	Tue Mar 07 18:46:09 2017 +0100
+++ b/E5Graphics/E5GraphicsView.py	Tue Mar 07 18:53:18 2017 +0100
@@ -239,13 +239,13 @@
             
         return QSizeF(endx + 1, endy + 1)
         
-    def __getDiagram(self, rect, format="PNG", filename=None):
+    def __getDiagram(self, rect, imageFormat="PNG", filename=None):
         """
         Private method to retrieve the diagram from the scene fitting it
         in the minimum rectangle.
         
         @param rect minimum rectangle fitting the diagram (QRectF)
-        @param format format for the image file (string)
+        @param imageFormat format for the image file (string)
         @param filename name of the file for non pixmaps (string)
         @return diagram pixmap to receive the diagram (QPixmap)
         """
@@ -257,7 +257,7 @@
                 item.setSelected(False)
             
         # step 2: grab the diagram
-        if format == "PNG":
+        if imageFormat == "PNG":
             paintDevice = QPixmap(int(rect.width()), int(rect.height()))
             paintDevice.fill(self.backgroundBrush().color())
         else:
@@ -278,21 +278,21 @@
         
         return paintDevice
         
-    def saveImage(self, filename, format="PNG"):
+    def saveImage(self, filename, imageFormat="PNG"):
         """
         Public method to save the scene to a file.
         
         @param filename name of the file to write the image to (string)
-        @param format format for the image file (string)
+        @param imageFormat format for the image file (string)
         @return flag indicating success (boolean)
         """
         rect = self._getDiagramRect(self.border)
-        if format == "SVG":
-            self.__getDiagram(rect, format=format, filename=filename)
+        if imageFormat == "SVG":
+            self.__getDiagram(rect, imageFormat=imageFormat, filename=filename)
             return True
         else:
             pixmap = self.__getDiagram(rect)
-            return pixmap.save(filename, format)
+            return pixmap.save(filename, imageFormat)
         
     def printDiagram(self, printer, diagramName=""):
         """

eric ide

mercurial