eric6/IconEditor/IconEditorPalette.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/IconEditor/IconEditorPalette.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/IconEditor/IconEditorPalette.py	Tue Mar 02 17:17:09 2021 +0100
@@ -34,17 +34,18 @@
         """
         super(IconEditorPalette, self).__init__(parent)
         
-        if self.layoutDirection == Qt.Horizontal:
-            direction = QBoxLayout.LeftToRight
+        if self.layoutDirection == Qt.Orientation.Horizontal:
+            direction = QBoxLayout.Direction.LeftToRight
         else:
-            direction = QBoxLayout.TopToBottom
+            direction = QBoxLayout.Direction.TopToBottom
         self.__layout = QBoxLayout(direction, self)
         self.setLayout(self.__layout)
         
         self.__preview = QLabel(self)
-        self.__preview.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+        self.__preview.setFrameStyle(QFrame.Shape.Panel | QFrame.Shadow.Sunken)
         self.__preview.setFixedHeight(64)
-        self.__preview.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.__preview.setAlignment(
+            Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter)
         self.__preview.setWhatsThis(self.tr(
             """<b>Preview</b>"""
             """<p>This is a 1:1 preview of the current icon.</p>"""
@@ -52,9 +53,10 @@
         self.__layout.addWidget(self.__preview)
         
         self.__color = QLabel(self)
-        self.__color.setFrameStyle(QFrame.Panel | QFrame.Sunken)
+        self.__color.setFrameStyle(QFrame.Shape.Panel | QFrame.Shadow.Sunken)
         self.__color.setFixedHeight(24)
-        self.__color.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.__color.setAlignment(
+            Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter)
         self.__color.setWhatsThis(self.tr(
             """<b>Current Color</b>"""
             """<p>This is the currently selected color used for drawing.</p>"""
@@ -62,7 +64,8 @@
         self.__layout.addWidget(self.__color)
         
         self.__colorTxt = QLabel(self)
-        self.__colorTxt.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.__colorTxt.setAlignment(
+            Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter)
         self.__colorTxt.setWhatsThis(self.tr(
             """<b>Current Color Value</b>"""
             """<p>This is the currently selected color value used for"""
@@ -113,7 +116,7 @@
         self.__layout.addWidget(self.__compositingGroup)
         
         spacer = QSpacerItem(
-            10, 10, QSizePolicy.Minimum, QSizePolicy.Expanding)
+            10, 10, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
         self.__layout.addItem(spacer)
     
     def previewChanged(self, pixmap):
@@ -170,9 +173,9 @@
         
         @param mode compositing mode to set (QPainter.CompositionMode)
         """
-        if mode == QPainter.CompositionMode_Source:
+        if mode == QPainter.CompositionMode.CompositionMode_Source:
             self.__sourceButton.setChecked(True)
-        elif mode == QPainter.CompositionMode_SourceOver:
+        elif mode == QPainter.CompositionMode.CompositionMode_SourceOver:
             self.__sourceOverButton.setChecked(True)
     
     def __compositingChanged(self, on):
@@ -185,7 +188,7 @@
         if on:
             if self.__sourceButton.isChecked():
                 self.compositingChanged.emit(
-                    QPainter.CompositionMode_Source)
+                    QPainter.CompositionMode.CompositionMode_Source)
             elif self.__sourceOverButton.isChecked():
                 self.compositingChanged.emit(
-                    QPainter.CompositionMode_SourceOver)
+                    QPainter.CompositionMode.CompositionMode_SourceOver)

eric ide

mercurial