# eric4.Helpviewer.Bookmarks.BookmarksModel

Module implementing the bookmark model class.

### Global Attributes

None

### Classes

BookmarksModel | Class implementing the bookmark model.

### Functions

None

## BookmarksModel

Class implementing the bookmark model.

### Derived from

QAbstractItemModel

### Class Attributes

MIMETYPE
SeparatorRole
TypeRole
UrlRole
UrlStringRole

### Class Methods

None

### Methods

BookmarksModel | Constructor
bookmarksManager | Public method to get a reference to the bookmarks manager.
columnCount | Public method to get the number of columns.
data | Public method to get data from the model.
dropMimeData | Public method to accept the mime data of a drop action.
entryAdded | Public slot to add a bookmark node.
entryChanged | Public method to change a node.
entryRemoved | Public slot to remove a bookmark node.
flags | Public method to get flags for a node cell.
hasChildren | Public method to check, if a parent node has some children.
headerData | Public method to get the header data.
index | Public method to get a model index for a node cell.
mimeData | Public method to return the mime data.
mimeTypes | Public method to report the supported mime types.
node | Public method to get a bookmark node given it's index.
nodeIndex | Public method to get a model index.
parent | Public method to get the index of the parent node.
removeRows | Public method to remove bookmarks from the model.
rowCount | Public method to determine the number of rows.
setData | Public method to set the data of a node cell.
supportedDropActions | Public method to report the supported drop actions.

### Static Methods

None

#### BookmarksModel (Constructor)

BookmarksModel(manager, parent = None)

Constructor

manager
  reference to the bookmark manager object (BookmarksManager)
parent
  reference to the parent object (QObject)

#### BookmarksModel.bookmarksManager

bookmarksManager()

Public method to get a reference to the bookmarks manager.

Returns:
  reference to the bookmarks manager object (BookmarksManager)

#### BookmarksModel.columnCount

columnCount(parent = QModelIndex())

Public method to get the number of columns.

parent
  index of parent (QModelIndex)

Returns:
  number of columns (integer)

#### BookmarksModel.data

data(index, role = Qt.DisplayRole)

Public method to get data from the model.

index
  index of bookmark to get data for (QModelIndex)
role
  data role (integer)

Returns:
  bookmark data (QVariant)

#### BookmarksModel.dropMimeData

dropMimeData(data, action, row, column, parent)

Public method to accept the mime data of a drop action.

data
  reference to the mime data (QMimeData)
action
  drop action requested (Qt.DropAction)
row
  row number (integer)
column
  column number (integer)
parent
  index of the parent node (QModelIndex)

Returns:
  flag indicating successful acceptance of the data (boolean)

#### BookmarksModel.entryAdded

entryAdded(node)

Public slot to add a bookmark node.

node
  reference to the bookmark node to add (BookmarkNode)

#### BookmarksModel.entryChanged

entryChanged(node)

Public method to change a node.

node
  reference to the bookmark node to change (BookmarkNode)

#### BookmarksModel.entryRemoved

entryRemoved(parent, row, node)

Public slot to remove a bookmark node.

parent
  reference to the parent bookmark node (BookmarkNode)
row
  row number of the node (integer)
node
  reference to the bookmark node to remove (BookmarkNode)

#### BookmarksModel.flags

flags(index)

Public method to get flags for a node cell.

index
  index of the node cell (QModelIndex)

Returns:
  flags (Qt.ItemFlags)

#### BookmarksModel.hasChildren

hasChildren(parent = QModelIndex())

Public method to check, if a parent node has some children.

parent
  index of the parent node (QModelIndex)

Returns:
  flag indicating the presence of children (boolean)

#### BookmarksModel.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)

#### BookmarksModel.index

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

Public method to get a model index for a node cell.

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

Returns:
  index (QModelIndex)

#### BookmarksModel.mimeData

mimeData(indexes)

Public method to return the mime data.

indexes
  list of indexes (QModelIndexList)

Returns:
  mime data (QMimeData)

#### BookmarksModel.mimeTypes

mimeTypes()

Public method to report the supported mime types.

Returns:
  supported mime types (QStringList)

#### BookmarksModel.node

node(index)

Public method to get a bookmark node given it's index.

index
  index of the node (QModelIndex)

Returns:
  bookmark node (BookmarkNode)

#### BookmarksModel.nodeIndex

nodeIndex(node)

Public method to get a model index.

node
  reference to the node to get the index for (BookmarkNode)

Returns:
  model index (QModelIndex)

#### BookmarksModel.parent

parent(index = QModelIndex())

Public method to get the index of the parent node.

index
  index of the child node (QModelIndex)

Returns:
  index of the parent node (QModelIndex)

#### BookmarksModel.removeRows

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

Public method to remove bookmarks from the model.

row
  row of the first bookmark to remove (integer)
count
  number of bookmarks to remove (integer)
index
  of the parent bookmark node (QModelIndex)

Returns:
  flag indicating successful removal (boolean)

#### BookmarksModel.rowCount

rowCount(parent = QModelIndex())

Public method to determine the number of rows.

parent
  index of parent (QModelIndex)

Returns:
  number of rows (integer)

#### BookmarksModel.setData

setData(index, value, role = Qt.EditRole)

Public method to set the data of a node cell.

index
  index of the node cell (QModelIndex)
value
  value to be set (QVariant)
role
  role of the data (integer)

Returns:
  flag indicating success (boolean)

#### BookmarksModel.supportedDropActions

supportedDropActions()

Public method to report the supported drop actions.

Returns:
  supported drop actions (Qt.DropAction)

Up