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

Public Member Functions

def __init__
 
def handleSelected
 
def handleDblSelected
 
def additem
 
def selectNodeItem
 
def selectItem
 

Public Attributes

 children
 
 last
 
 onSelect
 
 onDblSelect
 

Detailed Description

Tree(parent=None)
   Classe pour faire une vue d'un arbre

Definition at line 32 of file Tree.py.

Constructor & Destructor Documentation

def gui.Tree.Tree.__init__ (   self,
  parent = None,
  onSelect = None,
  onDblSelect = None 
)

Definition at line 36 of file Tree.py.

36 
37  def __init__(self,parent=None,onSelect=None,onDblSelect=None):
38  QListView.__init__(self,parent)
39  self.setCaption("Tree")
40  self.setRootIsDecorated(1)
41  self.setSorting(-1)
42  self.addColumn("Name")
43  self.children=[]
44  self.last=None
45  self.onSelect=onSelect
46  self.onDblSelect=onDblSelect
47  self.connect(self,SIGNAL('selectionChanged(QListViewItem *)'),
48  self.handleSelected)
49  self.connect(self,SIGNAL('doubleClicked(QListViewItem *, const QPoint &, int)'),
50  self.handleDblSelected)

Member Function Documentation

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

Definition at line 61 of file Tree.py.

References gui.Tree.Tree.last, gui.Tree.Tree.selectItem(), gui.GraphViewer.GraphViewer.selectItem(), and gui.graph.Graph.selectItem().

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

61 
62  def additem(self,item):
63  node=Node(self,item.label,item,self.last)
64  self.last=node
65  self.children.append(node)
66  CONNECTOR.Connect(item,"selected",self.selectItem,())
67  CONNECTOR.Connect(item,"add",node.addNode,())
68  return node
def gui.Tree.Tree.handleDblSelected (   self,
  node,
  point,
  col 
)

Definition at line 56 of file Tree.py.

References gui.Tree.Tree.onDblSelect.

56 
57  def handleDblSelected(self,node,point,col):
58  node.item.dblselected()
59  if self.onDblSelect:
60  self.onDblSelect(node.item)
def gui.Tree.Tree.handleSelected (   self,
  node 
)

Definition at line 51 of file Tree.py.

References gui.Tree.Tree.onSelect.

51 
52  def handleSelected(self,node):
53  node.item.selected()
54  if self.onSelect:
55  self.onSelect(node.item)
def gui.Tree.Tree.selectItem (   self,
  item 
)

Definition at line 73 of file Tree.py.

References SalomeWrap_DataModel.setSelected().

Referenced by gui.Tree.Tree.additem().

73 
74  def selectItem(self,item):
75  #print "selectItem",item
76  node=self.selectedItem()
77  if node.item is item:
78  #print "item has been selected at item level"
79  return
80 
81  #print "item has not been selected at item level"
82  #try another way
83  #find its father ???
84  it = QListViewItemIterator(self)
85  node = it.current()
86  while node:
87  if node.item is item:
88  break
89  it += 1
90  node = it.current()
91 
92  if node:
93  self.setSelected(node,True)
def gui.Tree.Tree.selectNodeItem (   self,
  item,
  node 
)

Definition at line 69 of file Tree.py.

References SalomeWrap_DataModel.setSelected().

69 
70  def selectNodeItem(self,item,node):
71  #print "selectNodeItem",node,item
72  self.setSelected(node,True)

Member Data Documentation

gui.Tree.Tree.children

Definition at line 42 of file Tree.py.

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

gui.Tree.Tree.last

Definition at line 43 of file Tree.py.

Referenced by gui.Tree.Tree.additem().

gui.Tree.Tree.onDblSelect

Definition at line 45 of file Tree.py.

Referenced by gui.Tree.Tree.handleDblSelected().

gui.Tree.Tree.onSelect

Definition at line 44 of file Tree.py.

Referenced by gui.Tree.Tree.handleSelected().


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