Qudi
Public Member Functions | Public Attributes | List of all members
automation.TreeModel Class Reference

A tree model for storing TreeItems in a tree structure. More...

Inheritance diagram for automation.TreeModel:
Inheritance graph
[legend]
Collaboration diagram for automation.TreeModel:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, parent=None)
 Create a TreeModel. More...
 
def columnCount (self, parent)
 Return number of columns. More...
 
def data (self, index, role)
 Retrieve data from model. More...
 
def flags (self, index)
 Get flags for item at index. More...
 
def headerData (self, section, orientation, role)
 Header for this model. More...
 
def index (self, row, column, parent)
 Make QModelIndex from row and column number. More...
 
def parent (self, index)
 Get parent index for item at index. More...
 
def rowCount (self, parent)
 Return number of rows in model. More...
 
def loadExecTree (self, tree, parent=None)
 Load a tree from a nested dictionary into the model. More...
 
def recursiveLoad (self, tree, parent)
 Recursively load a tree from a nested dictionary into the model. More...
 
def recursiveSave (self, parent)
 Save TreeModel into nested dict. More...
 

Public Attributes

 rootItem
 

Detailed Description

A tree model for storing TreeItems in a tree structure.

Constructor & Destructor Documentation

◆ __init__()

def automation.TreeModel.__init__ (   self,
  parent = None 
)

Create a TreeModel.

Parameters
parentTreeModel: parent model

Member Function Documentation

◆ columnCount()

def automation.TreeModel.columnCount (   self,
  parent 
)

Return number of columns.

Parameters
parentTreeModel: prent model

◆ data()

def automation.TreeModel.data (   self,
  index,
  role 
)

Retrieve data from model.

Parameters
indexQModelIndex: index of data
roleQtRole: role for data

◆ flags()

def automation.TreeModel.flags (   self,
  index 
)

Get flags for item at index.

Parameters
indexQModelIndex: index for item
Returns
flags: Qt model flags

◆ headerData()

def automation.TreeModel.headerData (   self,
  section,
  orientation,
  role 
)

Header for this model.

Parameters
sectionQModelIndex: index for header data
orientationheader orientation
roleQt role for header

◆ index()

def automation.TreeModel.index (   self,
  row,
  column,
  parent 
)

Make QModelIndex from row and column number.

Parameters
rowint: row number
columnint: column number
parentQAbstractModel: model parent
Returns
QModelIndex: index for item at position

◆ loadExecTree()

def automation.TreeModel.loadExecTree (   self,
  tree,
  parent = None 
)

Load a tree from a nested dictionary into the model.

Parameters
treedict: dictionary tree to be loaded
parentTreeItem: root item for loaded tree

◆ parent()

def automation.TreeModel.parent (   self,
  index 
)

Get parent index for item at index.

Parameters
indexQModelIndex: index for item
Returns
QModelIndex: index for parent

◆ recursiveLoad()

def automation.TreeModel.recursiveLoad (   self,
  tree,
  parent 
)

Recursively load a tree from a nested dictionary into the model.

Parameters
treedict: dictionary for (sub)tree to be loaded
parentTreeItem: root item for loaded (sub)tree

◆ recursiveSave()

def automation.TreeModel.recursiveSave (   self,
  parent 
)

Save TreeModel into nested dict.

Parameters
parentTreeItem: parent item
Returns
dict: dictionary containing tree

◆ rowCount()

def automation.TreeModel.rowCount (   self,
  parent 
)

Return number of rows in model.

Returns
int: number of rowa

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