# eric6.Helpviewer.History.HistoryMenu

Module implementing the history menu.

### Global Attributes

None

### Classes

HistoryMenu | Class implementing the history menu.
HistoryMenuModel | Class implementing a model for the history menu.
HistoryMostVisitedMenu | Class implementing the most visited history menu.
HistoryMostVisitedMenuModel | Class implementing a model to show the most visited history entries.

### Functions

None

## HistoryMenu

Class implementing the history menu.

### Signals

newUrl(QUrl, str)
  emitted to open a URL in a new tab
openUrl(QUrl, str)
  emitted to open a URL in the current tab

### Derived from

E5ModelMenu

### Class Attributes

None

### Class Methods

None

### Methods

HistoryMenu | Constructor
__aboutToShowClosedTabsMenu | Private slot to populate the closed tabs menu.
__activated | Private slot handling the activated signal.
__clearHistoryDialog | Private slot to clear the history.
__closedTabAvailable | Private slot to handle changes of the availability of closed tabs.
__showHistoryDialog | Private slot to show the history dialog.
postPopulated | Public method to add any actions after the tree.
prePopulated | Public method to add any actions before the tree.
setInitialActions | Public method to set the list of actions that should appear first in the menu.

### Static Methods

None

#### HistoryMenu (Constructor)

HistoryMenu(parent=None, tabWidget=None)

Constructor

parent
  reference to the parent widget (QWidget)
tabWidget
  reference to the tab widget managing the browser tabs (HelpTabWidget

#### HistoryMenu.__aboutToShowClosedTabsMenu

__aboutToShowClosedTabsMenu()

Private slot to populate the closed tabs menu.

#### HistoryMenu.__activated

__activated(idx)

Private slot handling the activated signal.

idx
  index of the activated item (QModelIndex)

#### HistoryMenu.__clearHistoryDialog

__clearHistoryDialog()

Private slot to clear the history.

#### HistoryMenu.__closedTabAvailable

__closedTabAvailable(avail)

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

avail
  flag indicating the availability of closed tabs (boolean)

#### HistoryMenu.__showHistoryDialog

__showHistoryDialog()

Private slot to show the history dialog.

#### HistoryMenu.postPopulated

postPopulated()

Public method to add any actions after the tree.

#### HistoryMenu.prePopulated

prePopulated()

Public method to add any actions before the tree.

Returns:
  flag indicating if any actions were added (boolean)

#### HistoryMenu.setInitialActions

setInitialActions(actions)

Public method to set the list of actions that should appear first in the menu.

actions
  list of initial actions (list of QAction)

Up

## HistoryMenuModel

Class implementing a model for the history menu.

It maps the first bunch of items of the source model to the root.

### Derived from

QAbstractProxyModel

### Class Attributes

MOVEDROWS

### Class Methods

None

### Methods

HistoryMenuModel | Constructor
bumpedRows | Public method to determine the number of rows moved to the root.
columnCount | Public method to get the number of columns.
index | Public method to create an index.
mapFromSource | Public method to map an index to the proxy model index.
mapToSource | Public method to map an index to the source model index.
mimeData | Public method to return the mime data.
parent | Public method to get the parent index.
rowCount | Public method to determine the number of rows.

### Static Methods

None

#### HistoryMenuModel (Constructor)

HistoryMenuModel(sourceModel, parent=None)

Constructor

sourceModel
  reference to the source model (QAbstractItemModel)
parent
  reference to the parent object (QObject)

#### HistoryMenuModel.bumpedRows

bumpedRows()

Public method to determine the number of rows moved to the root.

Returns:
  number of rows moved to the root (integer)

#### HistoryMenuModel.columnCount

columnCount(parent=QModelIndex())

Public method to get the number of columns.

parent
  index of parent (QModelIndex)

Returns:
  number of columns (integer)

#### HistoryMenuModel.index

index(row, column, parent=QModelIndex())

Public method to create an index.

row
  row number for the index (integer)
column
  column number for the index (integer)
parent
  index of the parent item (QModelIndex)

Returns:
  requested index (QModelIndex)

#### HistoryMenuModel.mapFromSource

mapFromSource(sourceIndex)

Public method to map an index to the proxy model index.

sourceIndex
  reference to a source model index (QModelIndex)

Returns:
  proxy model index (QModelIndex)

#### HistoryMenuModel.mapToSource

mapToSource(proxyIndex)

Public method to map an index to the source model index.

proxyIndex
  reference to a proxy model index (QModelIndex)

Returns:
  source model index (QModelIndex)

#### HistoryMenuModel.mimeData

mimeData(indexes)

Public method to return the mime data.

indexes
  list of indexes (QModelIndexList)

Returns:
  mime data (QMimeData)

#### HistoryMenuModel.parent

parent(index)

Public method to get the parent index.

index
  index of item to get parent (QModelIndex)

Returns:
  index of parent (QModelIndex)

#### HistoryMenuModel.rowCount

rowCount(parent=QModelIndex())

Public method to determine the number of rows.

parent
  index of parent (QModelIndex)

Returns:
  number of rows (integer)

Up

## HistoryMostVisitedMenu

Class implementing the most visited history menu.

### Signals

newUrl(QUrl, str)
  emitted to open a URL in a new tab
openUrl(QUrl, str)
  emitted to open a URL in the current tab

### Derived from

E5ModelMenu

### Class Attributes

None

### Class Methods

None

### Methods

HistoryMostVisitedMenu | Constructor
__activated | Private slot handling the activated signal.
prePopulated | Public method to add any actions before the tree.

### Static Methods

None

#### HistoryMostVisitedMenu (Constructor)

HistoryMostVisitedMenu(count, parent=None)

Constructor

count
  maximum number of entries to be shown (integer)
parent
  reference to the parent widget (QWidget)

#### HistoryMostVisitedMenu.__activated

__activated(idx)

Private slot handling the activated signal.

idx
  index of the activated item (QModelIndex)

#### HistoryMostVisitedMenu.prePopulated

prePopulated()

Public method to add any actions before the tree.

Returns:
  flag indicating if any actions were added (boolean)

Up

## HistoryMostVisitedMenuModel

Class implementing a model to show the most visited history entries.

### Derived from

QSortFilterProxyModel

### Class Attributes

None

### Class Methods

None

### Methods

HistoryMostVisitedMenuModel | Constructor
lessThan | Public method used to sort the displayed items.

### Static Methods

None

#### HistoryMostVisitedMenuModel (Constructor)

HistoryMostVisitedMenuModel(sourceModel, parent=None)

Constructor

sourceModel
  reference to the source model (QAbstractItemModel)
parent
  reference to the parent object (QObject)

#### HistoryMostVisitedMenuModel.lessThan

lessThan(left, right)

Public method used to sort the displayed items.

left
  index of left item (QModelIndex)
right
  index of right item (QModelIndex)

Returns:
  true, if left is less than right (boolean)

Up