# eric5.Helpviewer.HelpWebSearchWidget

Module implementing a web search widget for the web browser.

### Global Attributes

None

### Classes

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

### Functions

None

## HelpWebSearchWidget

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

HelpWebSearchWidget | 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.
__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

#### HelpWebSearchWidget (Constructor)

HelpWebSearchWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### HelpWebSearchWidget.__addEngineFromUrl

__addEngineFromUrl()

Private slot to add a search engine given its URL.

#### HelpWebSearchWidget.__changeCurrentEngine

__changeCurrentEngine()

Private slot to handle the selection of a search engine.

#### HelpWebSearchWidget.__completerActivated

__completerActivated(index)

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

index
  index of the item (QModelIndex)

#### HelpWebSearchWidget.__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)

#### HelpWebSearchWidget.__currentEngineChanged

__currentEngineChanged()

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

#### HelpWebSearchWidget.__engineImageChanged

__engineImageChanged()

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

#### HelpWebSearchWidget.__getSuggestions

__getSuggestions()

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

#### HelpWebSearchWidget.__loadSearches

__loadSearches()

Private method to load the recently performed web searches.

#### HelpWebSearchWidget.__newSuggestions

__newSuggestions(suggestions)

Private slot to receive a new list of suggestions.

suggestions
  list of suggestions (list of strings)

#### HelpWebSearchWidget.__searchButtonClicked

__searchButtonClicked()

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

#### HelpWebSearchWidget.__searchNow

__searchNow()

Private slot to perform the web search.

#### HelpWebSearchWidget.__setupCompleterMenu

__setupCompleterMenu()

Private method to create the completer menu.

#### HelpWebSearchWidget.__showEnginesMenu

__showEnginesMenu()

Private slot to handle the display of the engines menu.

#### HelpWebSearchWidget.__textEdited

__textEdited(txt)

Private slot to handle changes of the search text.

txt
  search text (string)

#### HelpWebSearchWidget.clear

clear()

Public method to clear all private data.

#### HelpWebSearchWidget.mousePressEvent

mousePressEvent(evt)

Protected method called by a mouse press event.

evt
  reference to the mouse event (QMouseEvent)

#### HelpWebSearchWidget.openSearchManager

openSearchManager()

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

Returns:
  reference to the opensearch manager object (OpenSearchManager)

#### HelpWebSearchWidget.preferencesChanged

preferencesChanged()

Public method to handle the change of preferences.

#### HelpWebSearchWidget.saveSearches

saveSearches()

Public method to save the recently performed web searches.

Up