eric6/WebBrowser/WebBrowserTabBar.py

changeset 8218
7c09585bd960
parent 8205
4a0f1f896341
child 8227
349308e84eeb
equal deleted inserted replaced
8217:385f60c94548 8218:7c09585bd960
24 """ 24 """
25 Constructor 25 Constructor
26 26
27 @param parent reference to the parent widget (WebBrowserTabWidget) 27 @param parent reference to the parent widget (WebBrowserTabWidget)
28 """ 28 """
29 super(WebBrowserTabBar, self).__init__(parent) 29 super().__init__(parent)
30 30
31 self.__tabWidget = parent 31 self.__tabWidget = parent
32 32
33 self.__previewPopup = None 33 self.__previewPopup = None
34 34
90 @param evt reference to the mouse move event (QMouseEvent) 90 @param evt reference to the mouse move event (QMouseEvent)
91 """ 91 """
92 if self.count() == 1: 92 if self.count() == 1:
93 return 93 return
94 94
95 super(WebBrowserTabBar, self).mouseMoveEvent(evt) 95 super().mouseMoveEvent(evt)
96 96
97 if Preferences.getWebBrowser("ShowPreview"): 97 if Preferences.getWebBrowser("ShowPreview"):
98 # Find the tab under the mouse 98 # Find the tab under the mouse
99 i = 0 99 i = 0
100 tabIndex = -1 100 tabIndex = -1
129 """ 129 """
130 if Preferences.getWebBrowser("ShowPreview"): 130 if Preferences.getWebBrowser("ShowPreview"):
131 # If leave tabwidget then hide previous tab preview 131 # If leave tabwidget then hide previous tab preview
132 self.__hidePreview() 132 self.__hidePreview()
133 133
134 super(WebBrowserTabBar, self).leaveEvent(evt) 134 super().leaveEvent(evt)
135 135
136 def mousePressEvent(self, evt): 136 def mousePressEvent(self, evt):
137 """ 137 """
138 Protected method to handle mouse press events. 138 Protected method to handle mouse press events.
139 139
140 @param evt reference to the mouse press event (QMouseEvent) 140 @param evt reference to the mouse press event (QMouseEvent)
141 """ 141 """
142 if Preferences.getWebBrowser("ShowPreview"): 142 if Preferences.getWebBrowser("ShowPreview"):
143 self.__hidePreview() 143 self.__hidePreview()
144 144
145 super(WebBrowserTabBar, self).mousePressEvent(evt) 145 super().mousePressEvent(evt)
146 146
147 def event(self, evt): 147 def event(self, evt):
148 """ 148 """
149 Public method to handle event. 149 Public method to handle event.
150 150
160 ): 160 ):
161 # suppress tool tips if we are showing previews 161 # suppress tool tips if we are showing previews
162 evt.setAccepted(True) 162 evt.setAccepted(True)
163 return True 163 return True
164 164
165 return super(WebBrowserTabBar, self).event(evt) 165 return super().event(evt)
166 166
167 def tabRemoved(self, index): 167 def tabRemoved(self, index):
168 """ 168 """
169 Public slot to handle the removal of a tab. 169 Public slot to handle the removal of a tab.
170 170

eric ide

mercurial