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 |
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 |