eric6/E5Graphics/E5GraphicsView.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/E5Graphics/E5GraphicsView.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/E5Graphics/E5GraphicsView.py	Tue Mar 02 17:17:09 2021 +0100
@@ -47,12 +47,14 @@
         
         self.__initialSceneSize = self.scene().sceneRect().size()
         self.setBackgroundBrush(QBrush(self.getBackgroundColor()))
-        self.setRenderHint(QPainter.Antialiasing, True)
-        self.setDragMode(QGraphicsView.RubberBandDrag)
-        self.setAlignment(Qt.Alignment(Qt.AlignLeft | Qt.AlignTop))
-        self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
-        self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
-        self.setViewportUpdateMode(QGraphicsView.SmartViewportUpdate)
+        self.setRenderHint(QPainter.RenderHint.Antialiasing, True)
+        self.setDragMode(QGraphicsView.DragMode.RubberBandDrag)
+        self.setAlignment(Qt.Alignment(
+            Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignTop))
+        self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn)
+        self.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn)
+        self.setViewportUpdateMode(
+            QGraphicsView.ViewportUpdateMode.SmartViewportUpdate)
         
         self.setWhatsThis(self.tr(
             "<b>Graphics View</b>\n"
@@ -305,7 +307,7 @@
             paintDevice.setViewBox(rect)
             paintDevice.setFileName(filename)
         painter = QPainter(paintDevice)
-        painter.setRenderHint(QPainter.Antialiasing, True)
+        painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
         self.scene().render(painter, QRectF(), rect)
         
         # step 3: reselect the widgets
@@ -420,7 +422,7 @@
                              marginX + width, marginY + height + 2)
             painter.setFont(font)
             painter.drawText(marginX, marginY + height + 4, width,
-                             fontHeight, Qt.AlignRight, s)
+                             fontHeight, Qt.AlignmentFlag.AlignRight, s)
             if not finishX or not finishY:
                 printer.newPage()
                 page += 1

eric ide

mercurial