eric6/Graphics/UMLItem.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8207
d359172d11be
diff -r 27f636beebad -r 2c730d5fd177 eric6/Graphics/UMLItem.py
--- a/eric6/Graphics/UMLItem.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Graphics/UMLItem.py	Tue Mar 02 17:17:09 2021 +0100
@@ -63,7 +63,8 @@
         self.model = model
         
         if colors is None:
-            self._colors = (QColor(Qt.black), QColor(Qt.white))
+            self._colors = (QColor(Qt.GlobalColor.black),
+                            QColor(Qt.GlobalColor.white))
         else:
             self._colors = colors
         self.setPen(QPen(self._colors[0]))
@@ -78,13 +79,14 @@
         
         if rounded:
             p = self.pen()
-            p.setCapStyle(Qt.RoundCap)
-            p.setJoinStyle(Qt.RoundJoin)
+            p.setCapStyle(Qt.PenCapStyle.RoundCap)
+            p.setJoinStyle(Qt.PenJoinStyle.RoundJoin)
         
-        self.setFlag(QGraphicsItem.ItemIsMovable, True)
-        self.setFlag(QGraphicsItem.ItemIsSelectable, True)
+        self.setFlag(QGraphicsItem.GraphicsItemFlag.ItemIsMovable, True)
+        self.setFlag(QGraphicsItem.GraphicsItemFlag.ItemIsSelectable, True)
         try:
-            self.setFlag(QGraphicsItem.ItemSendsGeometryChanges, True)
+            self.setFlag(
+                QGraphicsItem.GraphicsItemFlag.ItemSendsGeometryChanges, True)
         except AttributeError:
             # only available for Qt 4.6.0 and newer
             pass
@@ -175,7 +177,7 @@
         @param value the value of the change
         @return adjusted values
         """
-        if change == QGraphicsItem.ItemPositionChange:
+        if change == QGraphicsItem.GraphicsItemChange.ItemPositionChange:
             # 1. remember to adjust associations
             self.shouldAdjustAssociations = True
             
@@ -199,8 +201,8 @@
         """
         pen = self.pen()
         if (
-            (option.state & QStyle.State_Selected) ==
-            QStyle.State(QStyle.State_Selected)
+            (option.state & QStyle.StateFlag.State_Selected) ==
+            QStyle.State(QStyle.StateFlag.State_Selected)
         ):
             pen.setWidth(2)
         else:

eric ide

mercurial