Version: 8.3.0
gui.Tree.Node Class Reference
Inheritance diagram for gui.Tree.Node:
Collaboration diagram for gui.Tree.Node:

Public Member Functions

def __init__
 
def selectNode
 
def addNode
 
def delNode
 
def additem
 
def setOpen
 
def setOpen_old
 

Public Attributes

 item
 
 children
 

Detailed Description

Node(parent,text,item,after)
     Classe pour faire une vue d'un noeud d'un arbre

Definition at line 94 of file Tree.py.

Constructor & Destructor Documentation

def gui.Tree.Node.__init__ (   self,
  parent,
  text,
  item,
  after = None 
)

Definition at line 98 of file Tree.py.

98 
99  def __init__(self,parent,text,item,after=None):
100  if after is None:
101  QListViewItem.__init__(self,parent,text)
102  else:
103  QListViewItem.__init__(self,parent,after,text)
104  self.item=item
105  self.setPixmap(0,Icons.get_image(item.getIconName()))
106  self.setExpandable(self.item.isExpandable())
107  self.children = []

Member Function Documentation

def gui.Tree.Node.additem (   self,
  item 
)

Definition at line 123 of file Tree.py.

References gui.Tree.Tree.children, gui.Tree.Node.children, and gui.Tree.Node.delNode().

Referenced by gui.Tree.Node.addNode(), gui.Tree.Node.setOpen(), and gui.Tree.Node.setOpen_old().

124  def additem(self,item):
125  if self.children:
126  node=Node(self,item.label,item,self.children[-1])
127  else:
128  node=Node(self,item.label,item)
129  self.children.append(node)
130  #CONNECTOR.Connect(item,"selected",self.listView().selectNodeItem,(node,))
131  CONNECTOR.Connect(item,"selected",node.selectNode,())
132  CONNECTOR.Connect(item,"add",node.addNode,())
133  CONNECTOR.Connect(item,"remove",self.delNode,(node,))
134  return node
def gui.Tree.Node.addNode (   self,
  item 
)

Definition at line 111 of file Tree.py.

References gui.Tree.Tree.additem(), and gui.Tree.Node.additem().

112  def addNode(self,item):
113  #print "Tree.addNode",item
114  self.additem(item)
def gui.Tree.Node.delNode (   self,
  node 
)

Definition at line 115 of file Tree.py.

References gui.Tree.Node.delNode().

Referenced by gui.Tree.Node.additem(), and gui.Tree.Node.delNode().

116  def delNode(self,node):
117  #print "Tree.delNode",node,node.item
118  CONNECTOR.Disconnect(node.item,"selected",node.selectNode,())
119  CONNECTOR.Disconnect(node.item,"add",node.addNode,())
120  CONNECTOR.Disconnect(node.item,"remove",self.delNode,(node,))
121  self.takeItem(node)
122  self.children.remove(node)
def gui.Tree.Node.selectNode (   self,
  item 
)

Definition at line 108 of file Tree.py.

109  def selectNode(self,item):
110  self.listView().setSelected(self,True)
def gui.Tree.Node.setOpen (   self,
  o 
)

Definition at line 135 of file Tree.py.

References gui.Tree.Tree.additem(), gui.Tree.Node.additem(), and YACS::HMI::SchemaItem.childCount().

136  def setOpen(self,o):
137  if o and not self.childCount():
138  for child in self.item.getChildren():
139  self.additem(child)
140  QListViewItem.setOpen(self,o)
def gui.Tree.Node.setOpen_old (   self,
  o 
)

Definition at line 141 of file Tree.py.

References gui.Tree.Tree.additem(), gui.Tree.Node.additem(), gui.Tree.Tree.children, and gui.Tree.Node.children.

142  def setOpen_old(self,o):
143  if o:
144  #open
145  for child in self.item.getChildren():
146  self.additem(child)
147  else:
148  #close
149  for node in self.children:
150  #CONNECTOR.Disconnect(node.item,"selected",self.listView().selectNodeItem,(node,))
151  CONNECTOR.Disconnect(node.item,"selected",node.selectNode,())
152  CONNECTOR.Disconnect(node.item,"add",node.addNode,())
153  self.takeItem(node)
154  del node
155  self.children=[]
156  QListViewItem.setOpen(self,o)
157 

Member Data Documentation

gui.Tree.Node.children

Definition at line 106 of file Tree.py.

Referenced by gui.Tree.Node.additem(), and gui.Tree.Node.setOpen_old().

gui.Tree.Node.item

Definition at line 103 of file Tree.py.


The documentation for this class was generated from the following file: