src/eric7/WebBrowser/WebBrowserTabBar.py

branch
eric7
changeset 10436
f6881d10e995
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
22 22
23 def __init__(self, parent=None): 23 def __init__(self, parent=None):
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
28 @type WebBrowserTabWidget
28 """ 29 """
29 super().__init__(parent) 30 super().__init__(parent)
30 31
31 self.__tabWidget = parent 32 self.__tabWidget = parent
32 33
85 86
86 def mouseMoveEvent(self, evt): 87 def mouseMoveEvent(self, evt):
87 """ 88 """
88 Protected method to handle mouse move events. 89 Protected method to handle mouse move events.
89 90
90 @param evt reference to the mouse move event (QMouseEvent) 91 @param evt reference to the mouse move event
92 @type QMouseEvent
91 """ 93 """
92 if self.count() == 1: 94 if self.count() == 1:
93 return 95 return
94 96
95 super().mouseMoveEvent(evt) 97 super().mouseMoveEvent(evt)
124 126
125 def leaveEvent(self, evt): 127 def leaveEvent(self, evt):
126 """ 128 """
127 Protected method to handle leave events. 129 Protected method to handle leave events.
128 130
129 @param evt reference to the leave event (QEvent) 131 @param evt reference to the leave event
132 @type QEvent
130 """ 133 """
131 if Preferences.getWebBrowser("ShowPreview"): 134 if Preferences.getWebBrowser("ShowPreview"):
132 # If leave tabwidget then hide previous tab preview 135 # If leave tabwidget then hide previous tab preview
133 self.__hidePreview() 136 self.__hidePreview()
134 137
136 139
137 def mousePressEvent(self, evt): 140 def mousePressEvent(self, evt):
138 """ 141 """
139 Protected method to handle mouse press events. 142 Protected method to handle mouse press events.
140 143
141 @param evt reference to the mouse press event (QMouseEvent) 144 @param evt reference to the mouse press event
145 @type QMouseEvent
142 """ 146 """
143 if Preferences.getWebBrowser("ShowPreview"): 147 if Preferences.getWebBrowser("ShowPreview"):
144 self.__hidePreview() 148 self.__hidePreview()
145 149
146 super().mousePressEvent(evt) 150 super().mousePressEvent(evt)
150 Public method to handle event. 154 Public method to handle event.
151 155
152 This event handler just handles the tooltip event and passes the 156 This event handler just handles the tooltip event and passes the
153 handling of all others to the superclass. 157 handling of all others to the superclass.
154 158
155 @param evt reference to the event to be handled (QEvent) 159 @param evt reference to the event to be handled
156 @return flag indicating, if the event was handled (boolean) 160 @type QEvent
161 @return flag indicating, if the event was handled
162 @rtype bool
157 """ 163 """
158 if evt.type() == QEvent.Type.ToolTip and Preferences.getWebBrowser( 164 if evt.type() == QEvent.Type.ToolTip and Preferences.getWebBrowser(
159 "ShowPreview" 165 "ShowPreview"
160 ): 166 ):
161 # suppress tool tips if we are showing previews 167 # suppress tool tips if we are showing previews
166 172
167 def tabRemoved(self, index): # noqa: U100 173 def tabRemoved(self, index): # noqa: U100
168 """ 174 """
169 Public slot to handle the removal of a tab. 175 Public slot to handle the removal of a tab.
170 176
171 @param index index of the removed tab (integer) 177 @param index index of the removed tab
178 @type int
172 """ 179 """
173 if Preferences.getWebBrowser("ShowPreview"): 180 if Preferences.getWebBrowser("ShowPreview"):
174 self.__hidePreview() 181 self.__hidePreview()

eric ide

mercurial