# eric4.Helpviewer.History.HistoryModel

Module implementing the history model.

### Global Attributes

None

### Classes

HistoryModel | Class implementing the history model.

### Functions

None

## HistoryModel

Class implementing the history model.

### Derived from

QAbstractTableModel

### Class Attributes

DateRole
DateTimeRole
MaxRole
TitleRole
UrlRole
UrlStringRole

### Class Methods

None

### Methods

HistoryModel | Constructor
columnCount | Public method to get the number of columns.
data | Public method to get data from the model.
entryAdded | Public slot to handle the addition of a history entry.
entryUpdated | Public slot to handle the update of a history entry.
headerData | Public method to get the header data.
historyReset | Public slot to reset the model.
removeRows | Public method to remove history entries from the model.
rowCount | Public method to determine the number of rows.

### Static Methods

None

#### HistoryModel (Constructor)

HistoryModel(historyManager, parent = None)

Constructor

historyManager
  reference to the history manager object (HistoryManager)
parent
  reference to the parent object (QObject)

#### HistoryModel.columnCount

columnCount(parent = QModelIndex())

Public method to get the number of columns.

parent
  index of parent (QModelIndex)

Returns:
  number of columns (integer)

#### HistoryModel.data

data(index, role = Qt.DisplayRole)

Public method to get data from the model.

index
  index of history entry to get data for (QModelIndex)
role
  data role (integer)

Returns:
  history entry data (QVariant)

#### HistoryModel.entryAdded

entryAdded()

Public slot to handle the addition of a history entry.

#### HistoryModel.entryUpdated

entryUpdated(row)

Public slot to handle the update of a history entry.

row
  row number of the updated entry (integer)

#### HistoryModel.headerData

headerData(section, orientation, role = Qt.DisplayRole)

Public method to get the header data.

section
  section number (integer)
orientation
  header orientation (Qt.Orientation)
role
  data role (integer)

Returns:
  header data (QVariant)

#### HistoryModel.historyReset

historyReset()

Public slot to reset the model.

#### HistoryModel.removeRows

removeRows(row, count, parent = QModelIndex())

Public method to remove history entries from the model.

row
  row of the first history entry to remove (integer)
count
  number of history entries to remove (integer)
index
  of the parent entry (QModelIndex)

Returns:
  flag indicating successful removal (boolean)

#### HistoryModel.rowCount

rowCount(parent = QModelIndex())

Public method to determine the number of rows.

parent
  index of parent (QModelIndex)

Returns:
  number of rows (integer)

Up