# eric7.HelpViewer.HelpViewerWidget

Module implementing an embedded viewer for QtHelp and local HTML files.

### Global Attributes

None

### Classes

HelpViewerWidget | Class implementing an embedded viewer for QtHelp and local HTML files.

### Functions

None

## HelpViewerWidget

Class implementing an embedded viewer for QtHelp and local HTML files.

### Derived from

QWidget

### Class Attributes

MaxHistoryItems

### Class Methods

None

### Methods

HelpViewerWidget | Constructor
__activateCurrentPage | Private slot to activate the current page.
__addNavigationButton | Private method to create and add a navigation button.
__addNewPage | Private slot to add a new empty page.
__backward | Private slot to move one page backward.
__checkActionButtons | Private slot to set the enabled state of the action buttons.
__clearHistory | Private slot to clear the history of the current viewer.
__configureHelpDocumentation | Private slot to open the Help Documentation configuration page.
__currentFilterChanged | Private slot handling a change of the active QtHelp filter.
__currentPageChanged | Private slot handling the selection of another page.
__docsInstalled | Private slot handling the end of documentation installation.
__filterQtHelpDocumentation | Private slot to filter the QtHelp documentation.
__forward | Private slot to move one page foreward.
__getQtHelpCollectionFileName | Private method to determine the name of the QtHelp collection file.
__helpTopicSelected | Private slot handling the selection of a new help topic.
__indexingFinished | Private slot handling the end of the indexing process.
__indexingStarted | Private slot handling the start of the indexing process.
__initActionsMenu | Private method to initialize the actions menu.
__initFilterWidget | Private method to initialize the filter selection widget.
__initHelpEngine | Private method to initialize the QtHelp related stuff.
__initIndexingProgress | Private method to initialize the help documents indexing progress widget.
__initQWebEngine | Private method to initialize global QWebEngine related objects.
__initQWebEngineSettings | Private method to set the global web settings.
__lookForNewDocumentation | Private slot to look for new documentation to be loaded into the help database.
__manageQtHelpDocuments | Private slot to manage the QtHelp documentation database.
__navigationMenuActionTriggered | Private slot to go to the selected page.
__newViewer | Private method to create a new help viewer.
__openFile | Private slot to open a local help file (*.html).
__populateHelpSelector | Private method to populate the help selection combo box.
__populateNavigationStack | Private method to populate the stack of navigation widgets.
__reload | Private slot to reload the current page.
__removeOldDocumentation | Private slot to remove non-existing documentation from the help engine.
__searchWidgetClosed | Private slot to handle the closing of the search widget.
__selectNavigationWidget | Private slot to select the navigation widget.
__setupFilterCombo | Private slot to setup the filter combo box.
__showBackMenu | Private slot showing the backward navigation menu.
__showForwardMenu | Private slot showing the forward navigation menu.
__showInstallationError | Private slot to show installation errors.
__warning | Private slot handling warnings of the help engine.
__zoomIn | Private slot to zoom in.
__zoomOut | Private slot to zoom out.
__zoomReset | Private slot to reset the zoom level.
activate | Public method to activate the widget and search for a given word.
addPage | Public method to add a new help page with the given URL.
bookmarkPage | Public method to bookmark a page with the given data.
closeAllPages | Public slot to close all pages.
closeCurrentPage | Public slot to close the current page.
closeOtherPages | Public slot to close all other pages.
currentViewer | Public method to get the active viewer.
openPagesCount | Public method to get the count of open pages.
openUrl | Public slot to load a URL in the current page.
openUrlNewBackgroundPage | Public slot to load a URL in a new background page.
openUrlNewPage | Public slot to load a URL in a new page.
searchNext | Public slot to find the next occurrence of the current search term.
searchPrev | Public slot to find the previous occurrence of the current search term.
searchQtHelp | Public slot to search for a given search expression.
showHideSearch | Public slot to show or hide the search widget.
shutdown | Public method to perform shut down actions.
webProfile | Public method to get a reference to the global web profile object.
webSettings | Public method to get the web settings of the current profile.

### Static Methods

None

#### HelpViewerWidget (Constructor)

HelpViewerWidget(parent=None)

Constructor

parent (QWidget (optional))
  reference to the parent widget (defaults to None)

#### HelpViewerWidget.__activateCurrentPage

__activateCurrentPage()

Private slot to activate the current page.

#### HelpViewerWidget.__addNavigationButton

__addNavigationButton(iconName, toolTip)

Private method to create and add a navigation button.

iconName (str)
  name of the icon
toolTip (str)
  tooltip to be shown

Return:
  reference to the created button

Return Type:
  QToolButton

#### HelpViewerWidget.__addNewPage

__addNewPage()

Private slot to add a new empty page.

#### HelpViewerWidget.__backward

__backward()

Private slot to move one page backward.

#### HelpViewerWidget.__checkActionButtons

__checkActionButtons()

Private slot to set the enabled state of the action buttons.

#### HelpViewerWidget.__clearHistory

__clearHistory()

Private slot to clear the history of the current viewer.

#### HelpViewerWidget.__configureHelpDocumentation

__configureHelpDocumentation()

Private slot to open the Help Documentation configuration page.

#### HelpViewerWidget.__currentFilterChanged

__currentFilterChanged(filter_)

Private slot handling a change of the active QtHelp filter.

filter_ (str)
  filter name

#### HelpViewerWidget.__currentPageChanged

__currentPageChanged()

Private slot handling the selection of another page.

#### HelpViewerWidget.__docsInstalled

__docsInstalled(installed)

Private slot handling the end of documentation installation.

installed (bool)
  flag indicating that documents were installed

#### HelpViewerWidget.__filterQtHelpDocumentation

__filterQtHelpDocumentation(index)

Private slot to filter the QtHelp documentation.

index (int)
  index of the selected QtHelp documentation filter

#### HelpViewerWidget.__forward

__forward()

Private slot to move one page foreward.

#### HelpViewerWidget.__getQtHelpCollectionFileName

__getQtHelpCollectionFileName()

Private method to determine the name of the QtHelp collection file.

Return:
  path of the QtHelp collection file

Return Type:
  str

#### HelpViewerWidget.__helpTopicSelected

__helpTopicSelected()

Private slot handling the selection of a new help topic.

#### HelpViewerWidget.__indexingFinished

__indexingFinished()

Private slot handling the end of the indexing process.

#### HelpViewerWidget.__indexingStarted

__indexingStarted()

Private slot handling the start of the indexing process.

#### HelpViewerWidget.__initActionsMenu

__initActionsMenu()

Private method to initialize the actions menu.

#### HelpViewerWidget.__initFilterWidget

__initFilterWidget()

Private method to initialize the filter selection widget.

Return:
  reference to the generated widget

Return Type:
  QWidget

#### HelpViewerWidget.__initHelpEngine

__initHelpEngine()

Private method to initialize the QtHelp related stuff.

#### HelpViewerWidget.__initIndexingProgress

__initIndexingProgress()

Private method to initialize the help documents indexing progress widget.

Return:
  reference to the generated widget

Return Type:
  QWidget

#### HelpViewerWidget.__initQWebEngine

__initQWebEngine()

Private method to initialize global QWebEngine related objects.

#### HelpViewerWidget.__initQWebEngineSettings

__initQWebEngineSettings()

Private method to set the global web settings.

#### HelpViewerWidget.__lookForNewDocumentation

__lookForNewDocumentation()

Private slot to look for new documentation to be loaded into the help database.

#### HelpViewerWidget.__manageQtHelpDocuments

__manageQtHelpDocuments()

Private slot to manage the QtHelp documentation database.

#### HelpViewerWidget.__navigationMenuActionTriggered

__navigationMenuActionTriggered(act)

Private slot to go to the selected page.

act (QAction)
  reference to the action selected in the navigation menu

#### HelpViewerWidget.__newViewer

__newViewer()

Private method to create a new help viewer.

Return:
  tuple containing the reference to the created help viewer object and its type

Return Type:
  tuple of (HelpViewerImpl, EricTextEditType)

#### HelpViewerWidget.__openFile

__openFile()

Private slot to open a local help file (*.html).

#### HelpViewerWidget.__populateHelpSelector

__populateHelpSelector()

Private method to populate the help selection combo box.

#### HelpViewerWidget.__populateNavigationStack

__populateNavigationStack()

Private method to populate the stack of navigation widgets.

#### HelpViewerWidget.__reload

__reload()

Private slot to reload the current page.

#### HelpViewerWidget.__removeOldDocumentation

__removeOldDocumentation()

Private slot to remove non-existing documentation from the help engine.

#### HelpViewerWidget.__searchWidgetClosed

__searchWidgetClosed()

Private slot to handle the closing of the search widget.

#### HelpViewerWidget.__selectNavigationWidget

__selectNavigationWidget(button)

Private slot to select the navigation widget.

button (QAbstractButton)
  reference to the clicked button

#### HelpViewerWidget.__setupFilterCombo

__setupFilterCombo()

Private slot to setup the filter combo box.

#### HelpViewerWidget.__showBackMenu

__showBackMenu()

Private slot showing the backward navigation menu.

#### HelpViewerWidget.__showForwardMenu

__showForwardMenu()

Private slot showing the forward navigation menu.

#### HelpViewerWidget.__showInstallationError

__showInstallationError(message)

Private slot to show installation errors.

message (str)
  message to be shown

#### HelpViewerWidget.__warning

__warning(msg)

Private slot handling warnings of the help engine.

msg (str)
  message sent by the help engine

#### HelpViewerWidget.__zoomIn

__zoomIn()

Private slot to zoom in.

#### HelpViewerWidget.__zoomOut

__zoomOut()

Private slot to zoom out.

#### HelpViewerWidget.__zoomReset

__zoomReset()

Private slot to reset the zoom level.

#### HelpViewerWidget.activate

activate(searchWord=None, url=None)

Public method to activate the widget and search for a given word.

searchWord (str (optional))
  word to search for (defaults to None)
url (QUrl)
  URL to show in a new page

#### HelpViewerWidget.addPage

addPage(url=None, background=False)

Public method to add a new help page with the given URL.

url (QUrl (optional))
  requested URL (defaults to QUrl("about:blank"))
background (bool (optional))
  flag indicating to open the page in the background (defaults to False)

Return:
  reference to the created page

Return Type:
  HelpViewerImpl

#### HelpViewerWidget.bookmarkPage

bookmarkPage(title, url)

Public method to bookmark a page with the given data.

title (str)
  title of the page
url (QUrl)
  URL of the page

#### HelpViewerWidget.closeAllPages

closeAllPages()

Public slot to close all pages.

#### HelpViewerWidget.closeCurrentPage

closeCurrentPage()

Public slot to close the current page.

#### HelpViewerWidget.closeOtherPages

closeOtherPages()

Public slot to close all other pages.

#### HelpViewerWidget.currentViewer

currentViewer()

Public method to get the active viewer.

Return:
  reference to the active help viewer

Return Type:
  HelpViewerImpl

#### HelpViewerWidget.openPagesCount

openPagesCount()

Public method to get the count of open pages.

Return:
  count of open pages

Return Type:
  int

#### HelpViewerWidget.openUrl

openUrl(url)

Public slot to load a URL in the current page.

url (QUrl)
  URL to be opened

#### HelpViewerWidget.openUrlNewBackgroundPage

openUrlNewBackgroundPage(url)

Public slot to load a URL in a new background page.

url (QUrl)
  URL to be opened

#### HelpViewerWidget.openUrlNewPage

openUrlNewPage(url)

Public slot to load a URL in a new page.

url (QUrl)
  URL to be opened

#### HelpViewerWidget.searchNext

searchNext()

Public slot to find the next occurrence of the current search term.

#### HelpViewerWidget.searchPrev

searchPrev()

Public slot to find the previous occurrence of the current search term.

#### HelpViewerWidget.searchQtHelp

searchQtHelp(searchExpression)

Public slot to search for a given search expression.

searchExpression (str)
  expression to search for

#### HelpViewerWidget.showHideSearch

showHideSearch(visible)

Public slot to show or hide the search widget.

visible (bool)
  flag indicating to show or hide the search widget

#### HelpViewerWidget.shutdown

shutdown()

Public method to perform shut down actions.

#### HelpViewerWidget.webProfile

webProfile()

Public method to get a reference to the global web profile object.

Return:
  reference to the global web profile object

Return Type:
  QWebEngineProfile

#### HelpViewerWidget.webSettings

webSettings()

Public method to get the web settings of the current profile.

Return:
  web settings of the current profile

Return Type:
  QWebEngineSettings

Up