# eric7.HelpViewer.HelpViewerImplQTB

Module implementing the QTextBrowser based help viewer class.

### Global Attributes

AboutBlank
PageNotFound

### Classes

HelpViewerImplQTB | Class implementing the QTextBrowser based help viewer class.

### Functions

None

## HelpViewerImplQTB

Class implementing the QTextBrowser based help viewer class.

### Derived from

HelpViewerImpl, QTextBrowser

### Class Attributes

None

### Class Methods

None

### Methods

HelpViewerImplQTB | Constructor
__bookmarkPage | Private method called by the context menu to bookmark the page.
__canLoadResource | Private method to check, if the given resource can be loaded.
__closeOtherPages | Private method called by the context menu to close all other pages.
__closePage | Private method called by the context menu to close the current page.
__copyLink | Private method called by the context menu to copy a link to the clipboard.
__createLinkContextMenu | Private method to populate the context menu for URLs.
__openLinkInBackgroundPage | Private method called by the context menu to open a link in a background page.
__openLinkInNewPage | Private method called by the context menu to open a link in a new page.
__showContextMenu | Private slot to show the context menu.
doSetSource | Public method to load the data and show it.
event | Public method handling events.
gestureEvent | Protected method handling gesture events.
gotoHistory | Public method to step through the history.
isBackwardAvailable | Public method to check, if stepping backward through the history is available.
isEmptyPage | Public method to check, if the current page is the empty page.
isForwardAvailable | Public method to check, if stepping forward through the history is available.
isScaleDownAvailable | Public method to check, if the min.
isScaleUpAvailable | Public method to check, if the max.
keyPressEvent | Protected method to handle key press events.
link | Public method to get the URL of the shown document.
loadResource | Public method to load data of the specified type from the resource with the given name.
mousePressEvent | Protected method called by a mouse press event.
mouseReleaseEvent | Protected method called by a mouse release event.
pageTitle | Public method get the page title.
resetScale | Public method to reset the zoom level.
scale | Public method to get the zoom level.
scaleDown | Public method to zoom out.
scaleUp | Public method to zoom in.
setLink | Public method to set the URL of the document to be shown.
setScale | Public method to set the zoom level.
wheelEvent | Protected method to handle wheel event to zoom.

### Static Methods

None

#### HelpViewerImplQTB (Constructor)

HelpViewerImplQTB(engine, parent=None)

Constructor

engine (QHelpEngine)
  reference to the help engine
parent (QWidget)
  reference to the parent widget

#### HelpViewerImplQTB.__bookmarkPage

__bookmarkPage(act)

Private method called by the context menu to bookmark the page.

act (QAction)
  reference to the action that triggered

#### HelpViewerImplQTB.__canLoadResource

__canLoadResource(url)

Private method to check, if the given resource can be loaded.

url (QUrl)
  URL of resource to be loaded

Return:
  flag indicating, that the given URL can be handled

Return Type:
  bool

#### HelpViewerImplQTB.__closeOtherPages

__closeOtherPages()

Private method called by the context menu to close all other pages.

#### HelpViewerImplQTB.__closePage

__closePage()

Private method called by the context menu to close the current page.

#### HelpViewerImplQTB.__copyLink

__copyLink(act)

Private method called by the context menu to copy a link to the clipboard.

act (QAction)
  reference to the action that triggered

#### HelpViewerImplQTB.__createLinkContextMenu

__createLinkContextMenu(menu, linkUrl)

Private method to populate the context menu for URLs.

menu (QMenu)
  reference to the menu to be populated
linkUrl (QUrl)
  URL to create the menu part for

#### HelpViewerImplQTB.__openLinkInBackgroundPage

__openLinkInBackgroundPage(act)

Private method called by the context menu to open a link in a background page.

act (QAction)
  reference to the action that triggered

#### HelpViewerImplQTB.__openLinkInNewPage

__openLinkInNewPage(act)

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

act (QAction)
  reference to the action that triggered

#### HelpViewerImplQTB.__showContextMenu

__showContextMenu(pos)

Private slot to show the context menu.

pos (QPoint)
  position to show the context menu at

#### HelpViewerImplQTB.doSetSource

doSetSource(url, type_)

Public method to load the data and show it.

url (QUrl)
  URL of resource to load
type_ (QTextDocument.ResourceType)
  type of the resource to load

#### HelpViewerImplQTB.event

event(evt)

Public method handling events.

evt (QEvent)
  reference to the event

Return:
  flag indicating the event was handled

Return Type:
  bool

#### HelpViewerImplQTB.gestureEvent

gestureEvent(evt)

Protected method handling gesture events.

evt (QGestureEvent)
  reference to the gesture event

#### HelpViewerImplQTB.gotoHistory

gotoHistory(index)

Public method to step through the history.

index (int)
  history index (<0 backward, >0 forward)

#### HelpViewerImplQTB.isBackwardAvailable

isBackwardAvailable()

Public method to check, if stepping backward through the history is available.

Return:
  flag indicating backward stepping is available

Return Type:
  bool

#### HelpViewerImplQTB.isEmptyPage

isEmptyPage()

Public method to check, if the current page is the empty page.

Return:
  flag indicating an empty page is loaded

Return Type:
  bool

#### HelpViewerImplQTB.isForwardAvailable

isForwardAvailable()

Public method to check, if stepping forward through the history is available.

Return:
  flag indicating forward stepping is available

Return Type:
  bool

#### HelpViewerImplQTB.isScaleDownAvailable

isScaleDownAvailable()

Public method to check, if the min. zoom level is reached.

Return:
  flag indicating scale down is available

Return Type:
  bool

#### HelpViewerImplQTB.isScaleUpAvailable

isScaleUpAvailable()

Public method to check, if the max. zoom level is reached.

Return:
  flag indicating scale up is available

Return Type:
  bool

#### HelpViewerImplQTB.keyPressEvent

keyPressEvent(evt)

Protected method to handle key press events.

evt (QKeyEvent)
  reference to the key event

#### HelpViewerImplQTB.link

link()

Public method to get the URL of the shown document.

Return:
  URL of the document

Return Type:
  QUrl

#### HelpViewerImplQTB.loadResource

loadResource(type_, name)

Public method to load data of the specified type from the resource with the given name.

type_ (int)
  resource type
name (QUrl)
  resource name

Return:
  byte array containing the loaded data

Return Type:
  QByteArray

#### HelpViewerImplQTB.mousePressEvent

mousePressEvent(evt)

Protected method called by a mouse press event.

evt (QMouseEvent)
  reference to the mouse event

#### HelpViewerImplQTB.mouseReleaseEvent

mouseReleaseEvent(evt)

Protected method called by a mouse release event.

evt (QMouseEvent)
  reference to the mouse event

#### HelpViewerImplQTB.pageTitle

pageTitle()

Public method get the page title.

Return:
  page title

Return Type:
  str

#### HelpViewerImplQTB.resetScale

resetScale()

Public method to reset the zoom level.

#### HelpViewerImplQTB.scale

scale()

Public method to get the zoom level.

Return:
  current zoom level

Return Type:
  int

#### HelpViewerImplQTB.scaleDown

scaleDown()

Public method to zoom out.

#### HelpViewerImplQTB.scaleUp

scaleUp()

Public method to zoom in.

#### HelpViewerImplQTB.setLink

setLink(url)

Public method to set the URL of the document to be shown.

url (QUrl)
  source of the document

#### HelpViewerImplQTB.setScale

setScale(scale)

Public method to set the zoom level.

scale (int)
  zoom level to set

#### HelpViewerImplQTB.wheelEvent

wheelEvent(evt)

Protected method to handle wheel event to zoom.

evt (QWheelEvent)
  reference to the event object

Up