# eric6.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.
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.
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
  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.columnCount

columnCount(parent=None)

Public method to get the current column count.

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

Returns:
  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)

Returns:
  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)

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

#### WatchPointModel.getWatchPointByIndex

getWatchPointByIndex(index)

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

index
  index of the watch expression (QModelIndex)

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

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

Returns:
  index (QModelIndex)

#### WatchPointModel.hasChildren

hasChildren(parent=None)

Public method to check for the presence of child items.

parent
  index of parent item (QModelIndex)

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

#### WatchPointModel.headerData

headerData(section, orientation, role=Qt.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)

Returns:
  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)

Returns:
  requested index (QModelIndex)

#### WatchPointModel.parent

parent(index)

Public method to get the parent index.

index
  index of item to get parent (QModelIndex)

Returns:
  index of parent (QModelIndex)

#### WatchPointModel.rowCount

rowCount(parent=None)

Public method to get the current row count.

parent
  index of the parent item (QModelIndex)

Returns:
  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