# eric7.Debugger.WatchPointModel

Module implementing the Watch expression model.

### Global Attributes

None

### Classes

WatchPointModel | Class implementing a custom model for watch expressions.

### Functions

None

## WatchPointModel

Class implementing a custom model for watch expressions.

### Signals

dataAboutToBeChanged(QModelIndex, QModelIndex)
  emitted to indicate a change of the data

### Derived from

QAbstractItemModel

### Class Attributes

None

### Class Methods

None

### Methods

WatchPointModel | Constructor
addWatchPoint | Public method to add a new watch expression to the list.
addWatchPoints | Public method to add multiple watch expressions to the list.
columnCount | Public method to get the current column count.
data | Public method to get the requested data.
deleteAll | Public method to delete all watch expressions.
deleteWatchPointByIndex | Public method to set the values of a watch expression given by index.
deleteWatchPoints | Public method to delete a list of watch expressions given by their indexes.
flags | Public method to get item flags.
getAllWatchpoints | Public method to get the list of watchpoints.
getWatchPointByIndex | Public method to get the values of a watch expression given by index.
getWatchPointIndex | Public method to get the index of a watch expression given by expression.
hasChildren | Public method to check for the presence of child items.
headerData | Public method to get header data.
index | Public method to create an index.
parent | Public method to get the parent index.
rowCount | Public method to get the current row count.
setWatchPointByIndex | Public method to set the values of a watch expression given by index.
setWatchPointEnabledByIndex | Public method to set the enabled state of a watch expression given by index.

### Static Methods

None

#### WatchPointModel (Constructor)

WatchPointModel(parent=None)

Constructor

parent
  reference to the parent widget (QObject)

#### WatchPointModel.addWatchPoint

addWatchPoint(cond, special, properties)

Public method to add a new watch expression to the list.

cond (str)
  expression of the watch expression
special (str)
  special condition of the watch expression
properties (tuple of (bool, bool, int))
  properties of the watch expression (tuple of temporary flag, enabled flag, ignore count)

#### WatchPointModel.addWatchPoints

addWatchPoints(watchpoints)

Public method to add multiple watch expressions to the list.

watchpoints (list of (str, str, bool, bool, int))
  list of watch expressions with expression, special condition, temporary flag, enabled flag and ignore count each

#### WatchPointModel.columnCount

columnCount(parent=None)

Public method to get the current column count.

parent
  index of the parent item (QModelIndex) (Unused)

Return:
  column count (integer)

#### WatchPointModel.data

data(index, role)

Public method to get the requested data.

index
  index of the requested data (QModelIndex)
role
  role of the requested data (Qt.ItemDataRole)

Return:
  the requested data

#### WatchPointModel.deleteAll

deleteAll()

Public method to delete all watch expressions.

#### WatchPointModel.deleteWatchPointByIndex

deleteWatchPointByIndex(index)

Public method to set the values of a watch expression given by index.

index
  index of the watch expression (QModelIndex)

#### WatchPointModel.deleteWatchPoints

deleteWatchPoints(idxList)

Public method to delete a list of watch expressions given by their indexes.

idxList
  list of watch expression indexes (list of QModelIndex)

#### WatchPointModel.flags

flags(index)

Public method to get item flags.

index
  index of the requested flags (QModelIndex)

Return:
  item flags for the given index (Qt.ItemFlags)

#### WatchPointModel.getAllWatchpoints

getAllWatchpoints()

Public method to get the list of watchpoints.

Return:
  list of watchpoints

Return Type:
  list of list of [str, str, bool, bool, int]

#### WatchPointModel.getWatchPointByIndex

getWatchPointByIndex(index)

Public method to get the values of a watch expression given by index.

index
  index of the watch expression (QModelIndex)

Return:
  watch expression (list of six values (expression, special condition, temporary flag, enabled flag, ignore count))

Return Type:
  tuple of (str, str, bool, bool, int)

#### WatchPointModel.getWatchPointIndex

getWatchPointIndex(cond, special="")

Public method to get the index of a watch expression given by expression.

cond
  expression of the watch expression (string)
special
  special condition of the watch expression (string)

Return:
  index (QModelIndex)

#### WatchPointModel.hasChildren

hasChildren(parent=None)

Public method to check for the presence of child items.

parent
  index of parent item (QModelIndex)

Return:
  flag indicating the presence of child items (boolean)

#### WatchPointModel.headerData

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

Public method to get header data.

section
  section number of the requested header data (integer)
orientation
  orientation of the header (Qt.Orientation)
role
  role of the requested data (Qt.ItemDataRole)

Return:
  header data

#### WatchPointModel.index

index(row, column, parent=None)

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)

Return:
  requested index (QModelIndex)

#### WatchPointModel.parent

parent(index)

Public method to get the parent index.

index
  index of item to get parent (QModelIndex)

Return:
  index of parent (QModelIndex)

#### WatchPointModel.rowCount

rowCount(parent=None)

Public method to get the current row count.

parent
  index of the parent item (QModelIndex)

Return:
  row count (integer)

#### WatchPointModel.setWatchPointByIndex

setWatchPointByIndex(index, cond, special, properties)

Public method to set the values of a watch expression given by index.

index
  index of the watch expression (QModelIndex)
cond
  expression of the watch expression (string)
special
  special condition of the watch expression (string)
properties
  properties of the watch expression (tuple of temporary flag (bool), enabled flag (bool), ignore count (integer))

#### WatchPointModel.setWatchPointEnabledByIndex

setWatchPointEnabledByIndex(index, enabled)

Public method to set the enabled state of a watch expression given by index.

index
  index of the watch expression (QModelIndex)
enabled
  flag giving the enabled state (boolean)

Up