eric6/WebBrowser/QtHelp/HelpTocWidget.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/WebBrowser/QtHelp/HelpTocWidget.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/WebBrowser/QtHelp/HelpTocWidget.py	Tue Mar 02 17:17:09 2021 +0100
@@ -41,7 +41,8 @@
         self.__expandDepth = -2
         
         self.__tocWidget = self.__engine.contentWidget()
-        self.__tocWidget.setContextMenuPolicy(Qt.CustomContextMenu)
+        self.__tocWidget.setContextMenuPolicy(
+            Qt.ContextMenuPolicy.CustomContextMenu)
         self.__tocWidget.setSortingEnabled(True)
         
         self.__layout = QVBoxLayout(self)
@@ -66,17 +67,22 @@
             buttons = QApplication.mouseButtons()
             modifiers = QApplication.keyboardModifiers()
             
-            if buttons & Qt.MidButton:
+            if buttons & Qt.MouseButton.MidButton:
                 self.newTab.emit(url)
             else:
                 if (
-                    modifiers & (Qt.ControlModifier | Qt.ShiftModifier) ==
-                        (Qt.ControlModifier | Qt.ShiftModifier)
+                    modifiers & (
+                        Qt.KeyboardModifier.ControlModifier |
+                        Qt.KeyboardModifier.ShiftModifier
+                    ) == (
+                        Qt.KeyboardModifier.ControlModifier |
+                        Qt.KeyboardModifier.ShiftModifier
+                    )
                 ):
                     self.newBackgroundTab.emit(url)
-                elif modifiers & Qt.ControlModifier:
+                elif modifiers & Qt.KeyboardModifier.ControlModifier:
                     self.newTab.emit(url)
-                elif modifiers & Qt.ShiftModifier:
+                elif modifiers & Qt.KeyboardModifier.ShiftModifier:
                     self.newWindow.emit(url)
                 else:
                     self.openUrl.emit(url)
@@ -85,7 +91,7 @@
         """
         Private slot to be run after the contents was generated.
         """
-        self.__tocWidget.sortByColumn(0, Qt.AscendingOrder)
+        self.__tocWidget.sortByColumn(0, Qt.SortOrder.AscendingOrder)
         self.__expandTOC()
     
     def __expandTOC(self):
@@ -114,7 +120,7 @@
         
         @param evt reference to the focus event object (QFocusEvent)
         """
-        if evt.reason() != Qt.MouseFocusReason:
+        if evt.reason() != Qt.FocusReason.MouseFocusReason:
             self.__tocWidget.setFocus()
     
     def keyPressEvent(self, evt):
@@ -123,7 +129,7 @@
         
         @param evt reference to the key press event (QKeyEvent)
         """
-        if evt.key() == Qt.Key_Escape:
+        if evt.key() == Qt.Key.Key_Escape:
             self.escapePressed.emit()
     
     def syncToContent(self, url):

eric ide

mercurial