src/eric7/WebBrowser/WebBrowserWebSearchWidget.py

branch
eric7
changeset 10436
f6881d10e995
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
162 162
163 def __completerActivated(self, index): 163 def __completerActivated(self, index):
164 """ 164 """
165 Private slot handling the selection of an entry from the completer. 165 Private slot handling the selection of an entry from the completer.
166 166
167 @param index index of the item (QModelIndex) 167 @param index index of the item
168 @type QModelIndex
168 """ 169 """
169 if ( 170 if (
170 self.__suggestionsItem 171 self.__suggestionsItem
171 and self.__suggestionsItem.index().row() == index.row() 172 and self.__suggestionsItem.index().row() == index.row()
172 ): 173 ):
182 183
183 def __completerHighlighted(self, index): 184 def __completerHighlighted(self, index):
184 """ 185 """
185 Private slot handling the highlighting of an entry of the completer. 186 Private slot handling the highlighting of an entry of the completer.
186 187
187 @param index index of the item (QModelIndex) 188 @param index index of the item
188 @return flah indicating a successful highlighting (boolean) 189 @type QModelIndex
190 @return flah indicating a successful highlighting
191 @rtype bool
189 """ 192 """
190 if ( 193 if (
191 self.__suggestionsItem 194 self.__suggestionsItem
192 and self.__suggestionsItem.index().row() == index.row() 195 and self.__suggestionsItem.index().row() == index.row()
193 ): 196 ):
204 207
205 def __textEdited(self, txt): 208 def __textEdited(self, txt):
206 """ 209 """
207 Private slot to handle changes of the search text. 210 Private slot to handle changes of the search text.
208 211
209 @param txt search text (string) 212 @param txt search text
213 @type str
210 """ 214 """
211 if self.__suggestionsEnabled: 215 if self.__suggestionsEnabled:
212 if self.__suggestTimer is None: 216 if self.__suggestTimer is None:
213 self.__suggestTimer = QTimer(self) 217 self.__suggestTimer = QTimer(self)
214 self.__suggestTimer.setSingleShot(True) 218 self.__suggestTimer.setSingleShot(True)
230 234
231 def __newSuggestions(self, suggestions): 235 def __newSuggestions(self, suggestions):
232 """ 236 """
233 Private slot to receive a new list of suggestions. 237 Private slot to receive a new list of suggestions.
234 238
235 @param suggestions list of suggestions (list of strings) 239 @param suggestions list of suggestions
240 @type list of str
236 """ 241 """
237 self.__suggestions = suggestions 242 self.__suggestions = suggestions
238 self.__setupCompleterMenu() 243 self.__setupCompleterMenu()
239 self.__completer.complete() 244 self.__completer.complete()
240 245
356 361
357 def openSearchManager(self): 362 def openSearchManager(self):
358 """ 363 """
359 Public method to get a reference to the opensearch manager object. 364 Public method to get a reference to the opensearch manager object.
360 365
361 @return reference to the opensearch manager object (OpenSearchManager) 366 @return reference to the opensearch manager object
367 @rtype OpenSearchManager
362 """ 368 """
363 return self.__openSearchManager 369 return self.__openSearchManager
364 370
365 def __currentEngineChanged(self): 371 def __currentEngineChanged(self):
366 """ 372 """
397 403
398 def mousePressEvent(self, evt): 404 def mousePressEvent(self, evt):
399 """ 405 """
400 Protected method called by a mouse press event. 406 Protected method called by a mouse press event.
401 407
402 @param evt reference to the mouse event (QMouseEvent) 408 @param evt reference to the mouse event
409 @type QMouseEvent
403 """ 410 """
404 if evt.button() == Qt.MouseButton.XButton1: 411 if evt.button() == Qt.MouseButton.XButton1:
405 self.__mw.currentBrowser().triggerPageAction(QWebEnginePage.WebAction.Back) 412 self.__mw.currentBrowser().triggerPageAction(QWebEnginePage.WebAction.Back)
406 elif evt.button() == Qt.MouseButton.XButton2: 413 elif evt.button() == Qt.MouseButton.XButton2:
407 self.__mw.currentBrowser().triggerPageAction( 414 self.__mw.currentBrowser().triggerPageAction(

eric ide

mercurial