Table of Contents

Class: VariablesViewer eric3/Debugger/VariablesViewer.py

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.

Base Classes   
QListView
Methods   
__init__
addItem
contentsMouseDoubleClickEvent
findItem
generateItem
getDispType
getType
showVariable
showVariables
  __init__ 
__init__ (
        self,
        parent=None,
        scope=1,
        )

Constructor

Arguments

parent
the parent (QWidget)
scope
flag indicating global (0) or local (1) variables
  addItem 
addItem (
        self,
        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.

Arguments

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

  contentsMouseDoubleClickEvent 
contentsMouseDoubleClickEvent ( self,  mouseEvent )

Protected method of QListView.

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

  findItem 
findItem (
        self,
        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.

Arguments

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

  generateItem 
generateItem (
        self,
        parent,
        dvar,
        dvalue,
        dtype,
        )

Private method used to generate a QListViewItem representing a variable.

Arguments

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)

Returns

The item that was generated (QListViewItem or ClassNode).

  getDispType 
getDispType ( self,  vtype )

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

Arguments

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

Returns

displaystring (string or QString)

  getType 
getType ( self,  value )

Private method used to get the type of the value passed in.

Arguments

value
the real value (any)

Returns

type (string).

  showVariable 
showVariable ( self,  vlist )

Public method to show variables in a listview.

Arguments

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)

  showVariables 
showVariables (
        self,
        vlist,
        frmnr,
        )

Public method to show variables in a listview.

Arguments

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)

Table of Contents

This document was automatically generated by HappyDoc version 2.1