eric6/Snapshot/SnapshotTimer.py

changeset 8143
2c730d5fd177
parent 7945
76daafe10009
child 8218
7c09585bd960
--- a/eric6/Snapshot/SnapshotTimer.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Snapshot/SnapshotTimer.py	Tue Mar 02 17:17:09 2021 +0100
@@ -26,8 +26,11 @@
         """
         super(SnapshotTimer, self).__init__(None)
         
-        self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint |
-                            Qt.X11BypassWindowManagerHint)
+        self.setWindowFlags(
+            Qt.WindowType.WindowStaysOnTopHint |
+            Qt.WindowType.FramelessWindowHint |
+            Qt.WindowType.X11BypassWindowManagerHint
+        )
         
         self.__timer = QTimer()
         self.__textRect = QRect()
@@ -94,20 +97,26 @@
         
         if self.__time < self.__length:
             pal = QToolTip.palette()
-            textBackgroundColor = pal.color(QPalette.Active, QPalette.Base)
+            textBackgroundColor = pal.color(QPalette.ColorGroup.Active,
+                                            QPalette.ColorRole.Base)
             if self.__toggle:
-                textColor = pal.color(QPalette.Active, QPalette.Text)
+                textColor = pal.color(QPalette.ColorGroup.Active,
+                                      QPalette.ColorRole.Text)
             else:
-                textColor = pal.color(QPalette.Active, QPalette.Base)
+                textColor = pal.color(QPalette.ColorGroup.Active,
+                                      QPalette.ColorRole.Base)
             painter.setPen(textColor)
             painter.setBrush(textBackgroundColor)
             helpText = self.tr("Snapshot will be taken in %n seconds", "",
                                self.__length - self.__time)
             textRect = painter.boundingRect(
                 self.rect().adjusted(2, 2, -2, -2),
-                Qt.AlignHCenter | Qt.TextSingleLine, helpText)
-            painter.drawText(textRect, Qt.AlignHCenter | Qt.TextSingleLine,
-                             helpText)
+                Qt.AlignmentFlag.AlignHCenter | Qt.TextFlag.TextSingleLine,
+                helpText)
+            painter.drawText(
+                textRect,
+                Qt.AlignmentFlag.AlignHCenter | Qt.TextFlag.TextSingleLine,
+                helpText)
     
     def enterEvent(self, evt):
         """

eric ide

mercurial