# eric4.Helpviewer.HelpBrowser

Module implementing the helpbrowser.

### Classes

HelpBrowser | Class implementing the helpbrowser widget.

### Functions

None

## HelpBrowser

Class implementing the helpbrowser widget.

This is a subclass of the Qt QTextBrowser to implement a custimized setSource method. The implementation was influenced by Qt Assistant, which is copyright by Trolltech AS.

### Derived from

QTextBrowser

### Methods

HelpBrowser | Constructor
__openLinkInNewTab | Private method called by the context menu to open a link in a new window.
contextMenuEvent | Protected method called to create a context menu.
findNextPrev | Public slot to find the next occurrence of a text.
hasSelection | Public method to determine, if there is some text selected.
keyPressEvent | Protected method called by a key press.
keyReleaseEvent | Protected method called by a key release.
selectedText | Public method to get the selected text.
setSource | Public method used to set the source to be displayed.
supportsSearchWholeWord | Public method to determine, if a word based search is supported.

#### HelpBrowser (Constructor)

HelpBrowser(parent = None, name = QString(""))

Constructor

parent
  parent widget of this window (QWidget)
name
  name of this window (string or QString)

#### HelpBrowser.__openLinkInNewTab

__openLinkInNewTab()

Private method called by the context menu to open a link in a new window.

#### HelpBrowser.contextMenuEvent

contextMenuEvent(evt)

Protected method called to create a context menu.

This method is overridden from QTextBrowser.

evt
  reference to the context menu event object (QContextMenuEvent)

#### HelpBrowser.findNextPrev

findNextPrev(txt, case, word, backwards)

Public slot to find the next occurrence of a text.

txt
  text to search for (QString)
case
  flag indicating a case sensitive search (boolean)
word
  flag indicating a word based search (boolean)
backwards
  flag indicating a backwards search (boolean)

#### HelpBrowser.hasSelection

hasSelection()

Public method to determine, if there is some text selected.

Returns:
  flag indicating text has been selected (boolean)

#### HelpBrowser.keyPressEvent

keyPressEvent(evt)

Protected method called by a key press.

This method is overridden from QTextBrowser.

evt
  the key event (QKeyEvent)

#### HelpBrowser.keyReleaseEvent

keyReleaseEvent(evt)

Protected method called by a key release.

This method is overridden from QTextBrowser.

evt
  the key event (QKeyEvent)

#### HelpBrowser.selectedText

selectedText()

Public method to get the selected text.

Returns:
  selected text (QString)

#### HelpBrowser.setSource

setSource(name)

Public method used to set the source to be displayed.

This method is overridden from QTextBrowser.

name
  filename to be shown (QUrl)

#### HelpBrowser.supportsSearchWholeWord

supportsSearchWholeWord()

Public method to determine, if a word based search is supported.

Returns:
  flag indicating support for word based search (boolean)

Up