# eric6.WebBrowser.WebBrowserWebSearchWidget

Module implementing a web search widget for the web browser.

### Global Attributes

None

### Classes

WebBrowserWebSearchWidget | Class implementing a web search widget for the web browser.

### Functions

None

## WebBrowserWebSearchWidget

Class implementing a web search widget for the web browser.

### Signals

search(QUrl)
  emitted when the search should be done

### Derived from

E5ClearableLineEdit

### Class Attributes

None

### Class Methods

None

### Methods

WebBrowserWebSearchWidget | Constructor
__addEngineFromUrl | Private slot to add a search engine given its URL.
__changeCurrentEngine | Private slot to handle the selection of a search engine.
__completerActivated | Private slot handling the selection of an entry from the completer.
__completerHighlighted | Private slot handling the highlighting of an entry of the completer.
__currentEngineChanged | Private slot to track a change of the current search engine.
__engineImageChanged | Private slot to handle a change of the current search engine icon.
__getSuggestions | Private slot to get search suggestions from the configured search engine.
__loadSearches | Private method to load the recently performed web searches.
__newSuggestions | Private slot to receive a new list of suggestions.
__searchButtonClicked | Private slot to show the search menu via the search button.
__searchNow | Private slot to perform the web search.
__setupCompleterMenu | Private method to create the completer menu.
__showEnginesMenu | Private slot to handle the display of the engines menu.
__showEnginesMenuCallback | Private method handling the open search links callback.
__textEdited | Private slot to handle changes of the search text.
clear | Public method to clear all private data.
mousePressEvent | Protected method called by a mouse press event.
openSearchManager | Public method to get a reference to the opensearch manager object.
preferencesChanged | Public method to handle the change of preferences.
saveSearches | Public method to save the recently performed web searches.

### Static Methods

None

#### WebBrowserWebSearchWidget (Constructor)

WebBrowserWebSearchWidget(mainWindow, parent=None)

Constructor

mainWindow (WebBrowserWindow)
  reference to the browser main window
parent (QWidget)
  reference to the parent widget

#### WebBrowserWebSearchWidget.__addEngineFromUrl

__addEngineFromUrl()

Private slot to add a search engine given its URL.

#### WebBrowserWebSearchWidget.__changeCurrentEngine

__changeCurrentEngine()

Private slot to handle the selection of a search engine.

#### WebBrowserWebSearchWidget.__completerActivated

__completerActivated(index)

Private slot handling the selection of an entry from the completer.

index
  index of the item (QModelIndex)

#### WebBrowserWebSearchWidget.__completerHighlighted

__completerHighlighted(index)

Private slot handling the highlighting of an entry of the completer.

index
  index of the item (QModelIndex)

Returns:
  flah indicating a successful highlighting (boolean)

#### WebBrowserWebSearchWidget.__currentEngineChanged

__currentEngineChanged()

Private slot to track a change of the current search engine.

#### WebBrowserWebSearchWidget.__engineImageChanged

__engineImageChanged()

Private slot to handle a change of the current search engine icon.

#### WebBrowserWebSearchWidget.__getSuggestions

__getSuggestions()

Private slot to get search suggestions from the configured search engine.

#### WebBrowserWebSearchWidget.__loadSearches

__loadSearches()

Private method to load the recently performed web searches.

#### WebBrowserWebSearchWidget.__newSuggestions

__newSuggestions(suggestions)

Private slot to receive a new list of suggestions.

suggestions
  list of suggestions (list of strings)

#### WebBrowserWebSearchWidget.__searchButtonClicked

__searchButtonClicked()

Private slot to show the search menu via the search button.

#### WebBrowserWebSearchWidget.__searchNow

__searchNow()

Private slot to perform the web search.

#### WebBrowserWebSearchWidget.__setupCompleterMenu

__setupCompleterMenu()

Private method to create the completer menu.

#### WebBrowserWebSearchWidget.__showEnginesMenu

__showEnginesMenu()

Private slot to handle the display of the engines menu.

#### WebBrowserWebSearchWidget.__showEnginesMenuCallback

__showEnginesMenuCallback(res)

Private method handling the open search links callback.

res (list of dict)
  result of the JavaScript

#### WebBrowserWebSearchWidget.__textEdited

__textEdited(txt)

Private slot to handle changes of the search text.

txt
  search text (string)

#### WebBrowserWebSearchWidget.clear

clear()

Public method to clear all private data.

#### WebBrowserWebSearchWidget.mousePressEvent

mousePressEvent(evt)

Protected method called by a mouse press event.

evt
  reference to the mouse event (QMouseEvent)

#### WebBrowserWebSearchWidget.openSearchManager

openSearchManager()

Public method to get a reference to the opensearch manager object.

Returns:
  reference to the opensearch manager object (OpenSearchManager)

#### WebBrowserWebSearchWidget.preferencesChanged

preferencesChanged()

Public method to handle the change of preferences.

#### WebBrowserWebSearchWidget.saveSearches

saveSearches()

Public method to save the recently performed web searches.

Up