Table of Contents

Class: VariablesViewer ./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
getDispType
getType
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,
        dvtype,
        )

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)
dvtype
the typestring to be displayed (QString or 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.

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

  showVariables 
showVariables ( 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)


Table of Contents

This document was automatically generated on Fri Mar 14 19:54:45 2003 by HappyDoc version 2.1