eric6/WebBrowser/Navigation/NavigationBar.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/WebBrowser/Navigation/NavigationBar.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/WebBrowser/Navigation/NavigationBar.py	Tue Mar 02 17:17:09 2021 +0100
@@ -43,18 +43,20 @@
         self.__mw = mainWindow
         
         self.__layout = QHBoxLayout(self)
-        margin = self.style().pixelMetric(QStyle.PM_ToolBarItemMargin, None,
-                                          self)
+        margin = self.style().pixelMetric(
+            QStyle.PixelMetric.PM_ToolBarItemMargin, None, self)
         self.__layout.setContentsMargins(margin, margin, margin, margin)
         self.__layout.setSpacing(
-            self.style().pixelMetric(QStyle.PM_ToolBarItemSpacing, None, self))
+            self.style().pixelMetric(
+                QStyle.PixelMetric.PM_ToolBarItemSpacing, None, self))
         self.setLayout(self.__layout)
         
         self.__backButton = E5ToolButton(self)
         self.__backButton.setObjectName("navigation_back_button")
         self.__backButton.setToolTip(self.tr("Move one screen backward"))
-        self.__backButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
-        self.__backButton.setFocusPolicy(Qt.NoFocus)
+        self.__backButton.setToolButtonStyle(
+            Qt.ToolButtonStyle.ToolButtonIconOnly)
+        self.__backButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
         self.__backButton.setAutoRaise(True)
         self.__backButton.setIcon(
             UI.PixmapCache.getIcon("back"))
@@ -63,8 +65,9 @@
         self.__forwardButton = E5ToolButton(self)
         self.__forwardButton.setObjectName("navigation_forward_button")
         self.__forwardButton.setToolTip(self.tr("Move one screen forward"))
-        self.__forwardButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
-        self.__forwardButton.setFocusPolicy(Qt.NoFocus)
+        self.__forwardButton.setToolButtonStyle(
+            Qt.ToolButtonStyle.ToolButtonIconOnly)
+        self.__forwardButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
         self.__forwardButton.setAutoRaise(True)
         self.__forwardButton.setIcon(
             UI.PixmapCache.getIcon("forward"))
@@ -81,8 +84,9 @@
         self.__homeButton = E5ToolButton(self)
         self.__homeButton.setObjectName("navigation_home_button")
         self.__homeButton.setToolTip(self.tr("Move to the initial screen"))
-        self.__homeButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
-        self.__homeButton.setFocusPolicy(Qt.NoFocus)
+        self.__homeButton.setToolButtonStyle(
+            Qt.ToolButtonStyle.ToolButtonIconOnly)
+        self.__homeButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
         self.__homeButton.setAutoRaise(True)
         self.__homeButton.setIcon(
             UI.PixmapCache.getIcon("home"))
@@ -93,8 +97,9 @@
         self.__exitFullScreenButton.setIcon(
             UI.PixmapCache.getIcon("windowRestore"))
         self.__exitFullScreenButton.setToolTip(self.tr("Exit Fullscreen"))
-        self.__exitFullScreenButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
-        self.__exitFullScreenButton.setFocusPolicy(Qt.NoFocus)
+        self.__exitFullScreenButton.setToolButtonStyle(
+            Qt.ToolButtonStyle.ToolButtonIconOnly)
+        self.__exitFullScreenButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
         self.__exitFullScreenButton.setAutoRaise(True)
         self.__exitFullScreenButton.clicked.connect(self.__mw.toggleFullScreen)
         self.__exitFullScreenButton.setVisible(False)
@@ -106,9 +111,11 @@
             "navigation_supermenu_button")
         self.__superMenuButton.setIcon(UI.PixmapCache.getIcon("superMenu"))
         self.__superMenuButton.setToolTip(self.tr("Main Menu"))
-        self.__superMenuButton.setPopupMode(QToolButton.InstantPopup)
-        self.__superMenuButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
-        self.__superMenuButton.setFocusPolicy(Qt.NoFocus)
+        self.__superMenuButton.setPopupMode(
+            QToolButton.ToolButtonPopupMode.InstantPopup)
+        self.__superMenuButton.setToolButtonStyle(
+            Qt.ToolButtonStyle.ToolButtonIconOnly)
+        self.__superMenuButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
         self.__superMenuButton.setAutoRaise(True)
         self.__superMenuButton.setShowMenuInside(True)
         
@@ -120,7 +127,8 @@
             WebBrowserWebSearchWidget
         )
         self.__searchEdit = WebBrowserWebSearchWidget(self.__mw, self)
-        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
+        sizePolicy = QSizePolicy(QSizePolicy.Policy.Expanding,
+                                 QSizePolicy.Policy.Preferred)
         sizePolicy.setHorizontalStretch(2)
         sizePolicy.setVerticalStretch(0)
         self.__searchEdit.setSizePolicy(sizePolicy)
@@ -128,7 +136,7 @@
         self.__navigationSplitter.addWidget(self.__searchEdit)
         
         self.__navigationSplitter.setSizePolicy(
-            QSizePolicy.Expanding, QSizePolicy.Maximum)
+            QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Maximum)
         self.__navigationSplitter.setCollapsible(0, False)
         
         self.__layout.addLayout(self.__backNextLayout)
@@ -139,7 +147,7 @@
         self.__layout.addWidget(self.__exitFullScreenButton)
         self.__layout.addWidget(self.__superMenuButton)
         
-        self.setContextMenuPolicy(Qt.CustomContextMenu)
+        self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
         self.customContextMenuRequested.connect(self.__contextMenuRequested)
         
         self.__backMenu = QMenu(self)

eric ide

mercurial