# eric6.Helpviewer.HelpTabWidget

Module implementing the central widget showing the web pages.

### Global Attributes

None

### Classes

HelpTabWidget | Class implementing the central widget showing the web pages.

### Functions

None

## HelpTabWidget

Class implementing the central widget showing the web pages.

### Signals

browserClosed(QWidget)
  emitted after a browser was closed
browserZoomValueChanged(int)
  emitted to signal a change of the current browser's zoom level
showMessage(str)
  emitted to show a message in the main window status bar
sourceChanged(HelpBrowser, QUrl)
  emitted after the URL of a browser has changed
titleChanged(HelpBrowser, str)
  emitted after the title of a browser has changed

### Derived from

E5TabWidget

### Class Attributes

None

### Class Methods

None

### Methods

HelpTabWidget | Constructor
__aboutToShowClosedTabsMenu | Private slot to populate the closed tabs menu.
__closedTabAvailable | Private slot to handle changes of the availability of closed tabs.
__currentChanged | Private slot to handle an index change.
__elide | Private method to elide some text.
__guessUrlFromPath | Private method to guess an URL given a path string.
__iconChanged | Private slot to handle the icon change.
__initTabContextMenu | Private method to create the tab context menu.
__lineEditReturnPressed | Private slot to handle the entering of an URL.
__loadFinished | Private method to handle the loadFinished signal.
__loadStarted | Private method to handle the loadStarted signal.
__navigationMenuTriggered | Private slot called to handle the navigation button menu selection.
__pathSelected | Private slot called when a URL is selected from the completer.
__printPdfRequested | Private slot to handle a print to PDF request.
__printPreview | Private slot to generate a print preview.
__printRequested | Private slot to handle a print request.
__showContextMenu | Private slot to show the tab context menu.
__showNavigationMenu | Private slot to show the navigation button menu.
__sourceChanged | Private slot to handle a change of a browsers source.
__tabContextMenuClone | Private method to clone the selected tab.
__tabContextMenuClose | Private method to close the selected tab.
__tabContextMenuCloseOthers | Private slot to close all other tabs.
__tabContextMenuMoveLeft | Private method to move a tab one position to the left.
__tabContextMenuMoveRight | Private method to move a tab one position to the right.
__tabContextMenuPrint | Private method to print the selected tab.
__tabContextMenuPrintPdf | Private method to print the selected tab as PDF.
__tabContextMenuPrintPreview | Private method to show a print preview of the selected tab.
__titleChanged | Private slot to handle a change of a browsers title.
__windowCloseRequested | Private slot to handle the windowCloseRequested signal of a browser.
browserAt | Public method to get a reference to the browser with the given index.
browsers | Public method to get a list of references to all browsers.
canRestoreClosedTab | Public method to check, if closed tabs can be restored.
clearClosedTabsList | Public slot to clear the list of closed tabs.
closeAllBrowsers | Public slot called to handle the close all action.
closeBrowser | Public slot called to handle the close action.
closeBrowserAt | Public slot to close a browser based on its index.
closedTabsManager | Public slot to get a reference to the closed tabs manager.
currentBrowser | Public method to get a reference to the current browser.
currentUrlBar | Public method to get a reference to the current url bar.
getSourceFileList | Public method to get a list of all opened source files.
newBrowser | Public method to create a new web browser tab.
newBrowserAfter | Public method to create a new web browser tab after a given one.
preferencesChanged | Public slot to handle a change of preferences.
printBrowser | Public slot called to print the displayed page.
printBrowserPdf | Public slot called to print the displayed page to PDF.
printPreviewBrowser | Public slot called to show a print preview of the displayed file.
reloadAllBrowsers | Public slot to reload all browsers.
restoreAllClosedTabs | Public slot to restore all closed tabs.
restoreClosedTab | Public slot to restore the most recently closed tab.
shallShutDown | Public method to check, if the application should be shut down.
stackedUrlBar | Public method to get a reference to the stacked url bar.

### Static Methods

None

#### HelpTabWidget (Constructor)

HelpTabWidget(parent)

Constructor

parent
  reference to the parent widget (QWidget)

#### HelpTabWidget.__aboutToShowClosedTabsMenu

__aboutToShowClosedTabsMenu()

Private slot to populate the closed tabs menu.

#### HelpTabWidget.__closedTabAvailable

__closedTabAvailable(avail)

Private slot to handle changes of the availability of closed tabs.

avail
  flag indicating the availability of closed tabs (boolean)

#### HelpTabWidget.__currentChanged

__currentChanged(index)

Private slot to handle an index change.

index
  new index (integer)

#### HelpTabWidget.__elide

__elide(txt, mode=Qt.ElideRight, length=40)

Private method to elide some text.

txt
  text to be elided (string)
mode=
  elide mode (Qt.TextElideMode)
length=
  amount of characters to be used (integer)

Returns:
  the elided text (string)

#### HelpTabWidget.__guessUrlFromPath

__guessUrlFromPath(path)

Private method to guess an URL given a path string.

path
  path string to guess an URL for (string)

Returns:
  guessed URL (QUrl)

#### HelpTabWidget.__iconChanged

__iconChanged()

Private slot to handle the icon change.

#### HelpTabWidget.__initTabContextMenu

__initTabContextMenu()

Private method to create the tab context menu.

#### HelpTabWidget.__lineEditReturnPressed

__lineEditReturnPressed()

Private slot to handle the entering of an URL.

#### HelpTabWidget.__loadFinished

__loadFinished(ok)

Private method to handle the loadFinished signal.

ok
  flag indicating the result (boolean)

#### HelpTabWidget.__loadStarted

__loadStarted()

Private method to handle the loadStarted signal.

#### HelpTabWidget.__navigationMenuTriggered

__navigationMenuTriggered(act)

Private slot called to handle the navigation button menu selection.

act
  reference to the selected action (QAction)

#### HelpTabWidget.__pathSelected

__pathSelected(path)

Private slot called when a URL is selected from the completer.

path
  path to be shown (string)

#### HelpTabWidget.__printPdfRequested

__printPdfRequested(frame)

Private slot to handle a print to PDF request.

frame
  reference to the frame to be printed (QWebFrame)

#### HelpTabWidget.__printPreview

__printPreview(printer)

Private slot to generate a print preview.

printer
  reference to the printer object (QPrinter)

#### HelpTabWidget.__printRequested

__printRequested(frame)

Private slot to handle a print request.

frame
  reference to the frame to be printed (QWebFrame)

#### HelpTabWidget.__showContextMenu

__showContextMenu(coord, index)

Private slot to show the tab context menu.

coord
  the position of the mouse pointer (QPoint)
index
  index of the tab the menu is requested for (integer)

#### HelpTabWidget.__showNavigationMenu

__showNavigationMenu()

Private slot to show the navigation button menu.

#### HelpTabWidget.__sourceChanged

__sourceChanged(url)

Private slot to handle a change of a browsers source.

url
  URL of the new site (QUrl)

#### HelpTabWidget.__tabContextMenuClone

__tabContextMenuClone()

Private method to clone the selected tab.

#### HelpTabWidget.__tabContextMenuClose

__tabContextMenuClose()

Private method to close the selected tab.

#### HelpTabWidget.__tabContextMenuCloseOthers

__tabContextMenuCloseOthers()

Private slot to close all other tabs.

#### HelpTabWidget.__tabContextMenuMoveLeft

__tabContextMenuMoveLeft()

Private method to move a tab one position to the left.

#### HelpTabWidget.__tabContextMenuMoveRight

__tabContextMenuMoveRight()

Private method to move a tab one position to the right.

#### HelpTabWidget.__tabContextMenuPrint

__tabContextMenuPrint()

Private method to print the selected tab.

#### HelpTabWidget.__tabContextMenuPrintPdf

__tabContextMenuPrintPdf()

Private method to print the selected tab as PDF.

#### HelpTabWidget.__tabContextMenuPrintPreview

__tabContextMenuPrintPreview()

Private method to show a print preview of the selected tab.

#### HelpTabWidget.__titleChanged

__titleChanged(title)

Private slot to handle a change of a browsers title.

title
  new title (string)

#### HelpTabWidget.__windowCloseRequested

__windowCloseRequested()

Private slot to handle the windowCloseRequested signal of a browser.

#### HelpTabWidget.browserAt

browserAt(index)

Public method to get a reference to the browser with the given index.

index
  index of the browser to get (integer)

Returns:
  reference to the indexed browser (HelpBrowser)

#### HelpTabWidget.browsers

browsers()

Public method to get a list of references to all browsers.

Returns:
  list of references to browsers (list of HelpBrowser)

#### HelpTabWidget.canRestoreClosedTab

canRestoreClosedTab()

Public method to check, if closed tabs can be restored.

Returns:
  flag indicating that closed tabs can be restored (boolean)

#### HelpTabWidget.clearClosedTabsList

clearClosedTabsList()

Public slot to clear the list of closed tabs.

#### HelpTabWidget.closeAllBrowsers

closeAllBrowsers()

Public slot called to handle the close all action.

#### HelpTabWidget.closeBrowser

closeBrowser()

Public slot called to handle the close action.

#### HelpTabWidget.closeBrowserAt

closeBrowserAt(index)

Public slot to close a browser based on its index.

index
  index of browser to close (integer)

#### HelpTabWidget.closedTabsManager

closedTabsManager()

Public slot to get a reference to the closed tabs manager.

Returns:
  reference to the closed tabs manager (ClosedTabsManager)

#### HelpTabWidget.currentBrowser

currentBrowser()

Public method to get a reference to the current browser.

Returns:
  reference to the current browser (HelpBrowser)

#### HelpTabWidget.currentUrlBar

currentUrlBar()

Public method to get a reference to the current url bar.

Returns:
  reference to the current url bar (UrlBar)

#### HelpTabWidget.getSourceFileList

getSourceFileList()

Public method to get a list of all opened source files.

Returns:
  dictionary with tab id as key and host/namespace as value

#### HelpTabWidget.newBrowser

newBrowser(link=None, requestData=None, position=-1)

Public method to create a new web browser tab.

link
  link to be shown (string or QUrl)
requestData
  tuple containing the request data (QNetworkRequest, QNetworkAccessManager.Operation, QByteArray)
position=
  position to create the new tab at or -1 to add it to the end (integer)

#### HelpTabWidget.newBrowserAfter

newBrowserAfter(browser, link=None, requestData=None)

Public method to create a new web browser tab after a given one.

browser
  reference to the browser to add after (HelpBrowser)
link
  link to be shown (string or QUrl)
requestData
  tuple containing the request data (QNetworkRequest, QNetworkAccessManager.Operation, QByteArray)

#### HelpTabWidget.preferencesChanged

preferencesChanged()

Public slot to handle a change of preferences.

#### HelpTabWidget.printBrowser

printBrowser(browser=None)

Public slot called to print the displayed page.

browser
  reference to the browser to be printed (HelpBrowser)

#### HelpTabWidget.printBrowserPdf

printBrowserPdf(browser=None)

Public slot called to print the displayed page to PDF.

browser
  reference to the browser to be printed (HelpBrowser)

#### HelpTabWidget.printPreviewBrowser

printPreviewBrowser(browser=None)

Public slot called to show a print preview of the displayed file.

browser
  reference to the browser to be printed (HelpBrowserWV)

#### HelpTabWidget.reloadAllBrowsers

reloadAllBrowsers()

Public slot to reload all browsers.

#### HelpTabWidget.restoreAllClosedTabs

restoreAllClosedTabs()

Public slot to restore all closed tabs.

#### HelpTabWidget.restoreClosedTab

restoreClosedTab()

Public slot to restore the most recently closed tab.

#### HelpTabWidget.shallShutDown

shallShutDown()

Public method to check, if the application should be shut down.

Returns:
  flag indicating a shut down (boolean)

#### HelpTabWidget.stackedUrlBar

stackedUrlBar()

Public method to get a reference to the stacked url bar.

Returns:
  reference to the stacked url bar (StackedUrlBar)

Up