# eric3.Debugger.VariablesViewer

Module implementing the variables viewer widget.

### Classes

ArrayElementVarNode | Class implementing a QListViewItem that represents an array element.
SpecialArrayElementVarNode | Class implementing a QListViewItem that represents a special array variable node.
SpecialVarNode | Class implementing a QListViewItem that represents a special variable node.
VariablesViewer | Class implementing the variables viewer widget.

### Functions

None

## ArrayElementVarNode

Class implementing a QListViewItem that represents an array element.

### Derived from

QListViewItem

### Methods

ArrayElementVarNode | Constructor
key | Overridden method generating the key for this item.

### ArrayElementVarNode (Constructor)

ArrayElementVarNode(parent, dvar, dvalue, dtype)

Constructor

parent
  parent of this item
dvar
  variable name (string or QString)
dvalue
  value string (string or QString)
dtype
  type string (string or QString)

### ArrayElementVarNode.key

key(column, ascending)

Overridden method generating the key for this item.

column
  the colomn to sort on (integer)
ascending
  sort order (default)

Up

## SpecialArrayElementVarNode

Class implementing a QListViewItem that represents a special array variable node.

### Derived from

SpecialVarNode

### Methods

SpecialArrayElementVarNode | Constructor
key | Overridden method generating the key for this item.

### SpecialArrayElementVarNode (Constructor)

SpecialArrayElementVarNode(parent, dvar, dvalue, dtype, frmnr, scope)

Constructor

parent
  parent of this item
dvar
  variable name (string or QString)
dvalue
  value string (string or QString)
dtype
  type string (string or QString)
frmnr
  frame number (0 is the current frame) (int)
scope
  flag indicating global (1) or local (0) variables

### SpecialArrayElementVarNode.key

key(column, ascending)

Overridden method generating the key for this item.

column
  the colomn to sort on (integer)
ascending
  sort order (default)

Up

## SpecialVarNode

Class implementing a QListViewItem that represents a special variable node.

These special variable nodes are generated for classes, lists, tuples and dictionaries.

### Derived from

QListViewItem

### Methods

SpecialVarNode | Constructor
setOpen | Public slot to set/reset the open state.

### SpecialVarNode (Constructor)

SpecialVarNode(parent, dvar, dvalue, dtype, frmnr, scope)

Constructor

parent
  parent of this item
dvar
  variable name (string or QString)
dvalue
  value string (string or QString)
dtype
  type string (string or QString)
frmnr
  frame number (0 is the current frame) (int)
scope
  flag indicating global (1) or local (0) variables

### SpecialVarNode.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
  flag indicating the open state

Up

## VariablesViewer

Class implementing the variables viewer widget.

This widget is used to display the variables of the program being debugged in a tree. Compound types will be shown with their main entry first. Once the subtree has been expanded, the individual entries will be shown. Double clicking an entry will popup a dialog showing the variables parameters in a more readable form. This is especially useful for lengthy strings.

This widget has two modes for displaying the global and the local variables.

### Derived from

QListView

### Methods

VariablesViewer | Constructor
__buildTreePath | Private method to build up a path from the top to an item.
__unicode | Private method to convert a string to unicode.
addItem | Private method used to add an item to the listview.
contentsMouseDoubleClickEvent | Protected method of QListView.
findItem | Reimplemented method
generateItem | Private method used to generate a QListViewItem representing a variable.
getDispType | Private method used to get the display string for type vtype.
handleCollapsed | Private slot to handle the collapsed signal.
handleExpanded | Private slot to handle the expanded signal.
handleResetUI | Public method to reset the VariablesViewer.
showVariable | Public method to show variables in a listview.
showVariables | Public method to show variables in a listview.

### VariablesViewer (Constructor)

VariablesViewer(parent=None, scope=1)

Constructor

parent
  the parent (QWidget)
scope
  flag indicating global (1) or local (0) variables

### VariablesViewer.__buildTreePath

__buildTreePath(itm)

Private method to build up a path from the top to an item.

itm
  item to build the path for (QListViewItem)

Returns:
  list of names denoting the path from the top (list of strings)

### VariablesViewer.__unicode

__unicode(s)

Private method to convert a string to unicode.

s
  the string to be converted (string)

Returns:
  unicode representation of s (unicode object)

### VariablesViewer.addItem

addItem(parent, vtype, var, value)

Private method used to add an item to the listview.

If the item is of a type with subelements (i.e. list, dictionary, tuple), these subelements are added by calling this method recursively.

parent
  the parent of the item to be added (QListViewItem or None)
vtype
  the type of the item to be added (string)
var
  the variable name (string)
value
  the value string (string)

Returns:
  The item that was added to the listview (QListViewItem).

### VariablesViewer.contentsMouseDoubleClickEvent

contentsMouseDoubleClickEvent(mouseEvent)

Protected method of QListView.

Reimplemented to disable expanding/collapsing of items when double-clicking. Instead the double-clicked entry is opened.

mouseEvent
  The mouse event object. (QMouseEvent)

### VariablesViewer.findItem

findItem(slist, column, node=None)

Reimplemented method

It is used to find a specific item in column, that is a child of node. If node is None, a child of the QListView is searched.

slist
  searchlist (list of strings or QStrings)
column
  index of column to search in (int)
node
  start point of the search

Returns:
  the found item or None

### VariablesViewer.generateItem

generateItem(parent, dvar, dvalue, dtype, isSpecial = 0)

Private method used to generate a QListViewItem representing a variable.

parent
  parent of the item to be generated
dvar
  variable name (string or QString)
dvalue
  value string (string or QString)
dtype
  type string (string or QString)
isSpecial
  flag indicating that a special node should be generated (boolean)

Returns:
  The item that was generated (QListViewItem or SpecialVarNode).

### VariablesViewer.getDispType

getDispType(vtype)

Private method used to get the display string for type vtype.

vtype
  the type, the display string should be looked up for (string)

Returns:
  displaystring (string or QString)

### VariablesViewer.handleCollapsed

handleCollapsed(itm)

Private slot to handle the collapsed signal.

itm
  item being expanded (QListViewItem)

### VariablesViewer.handleExpanded

handleExpanded(itm)

Private slot to handle the expanded signal.

itm
  item being expanded (QListViewItem)

### VariablesViewer.handleResetUI

handleResetUI()

Public method to reset the VariablesViewer.

### VariablesViewer.showVariable

showVariable(vlist)

Public method to show variables in a listview.

vlist
  the list of variables to be displayed. Each listentry is a tuple of three values.
  - the variable name (string)
  - the variables type (string)
  - the variables value (string)

### VariablesViewer.showVariables

showVariables(vlist, frmnr)

Public method to show variables in a listview.

vlist
  the list of variables to be displayed. Each listentry is a tuple of three values.
  - the variable name (string)
  - the variables type (string)
  - the variables value (string)
frmnr
  frame number (0 is the current frame) (int)

Up