Previous topic

qarbon.qt.gui.axeswidget

Next topic

qarbon.qt.gui.basetree

This Page

qarbon.qt.gui.basemodel

A base model and a base tree item.

Inheritance diagram of BaseTreeItem, BaseModel, BaseProxyModel

Classes

BaseTreeItem A generic node
BaseModel The base class for all Qt models.
BaseProxyModel A base Qt filter & sort model
class qarbon.qt.gui.basemodel.BaseTreeItem(model, data, parent=None)[source]

Bases: object

A generic node

DisplayFunc

alias of str

itemData()[source]

The internal itemData object

Returns:(object) object holding the data of this item
depth()[source]

Depth of the node in the hierarchy

Returns:(int) the node depth
appendChild(child)[source]

Adds a new child node

Parameters:child – (BaseTreeItem) child to be added
child(row)[source]

Returns the child in the given row

Returns:(BaseTreeItem) the child node for the given row
childCount()[source]

Returns the number of childs for this node

Returns:(int) number of childs for this node
hasChildren()[source]
data(index)[source]

Returns the data of this node for the given index

Returns:(object) the data for the given index
icon(index)[source]
toolTip(index)[source]
setData(index, data)[source]

Sets the node data

Parameters:data – (object) the data to be associated with this node
parent()[source]

Returns the parent node or None if no parent exists

Returns:(BaseTreeItem) the parent node
row()[source]

Returns the row for this node

Returns:(int) row number for this node
display()[source]

Returns the display string for this node

Returns:(str) the node’s display string
mimeData(index)[source]
role()[source]

Returns the prefered role for the item. This implementation returns string Unknown

This method should be able to return any kind of python object as long as the model that is used is compatible.

Returns:the role in form of element type
class qarbon.qt.gui.basemodel.BaseModel(parent=None, data=None)[source]

Bases: PyQt4.QtCore.QAbstractItemModel

The base class for all Qt models.

ColumnNames = ()
ColumnRoles = ((),)
DftFont = <PyQt4.QtGui.QFont object at 0x367e790>
createNewRootItem()[source]
refresh(refresh_source=False)[source]
setupModelData(data)[source]
roleIcon(role)[source]
roleSize(role)[source]
roleToolTip(role)[source]
setDataSource(data_src)[source]
dataSource()[source]
setSelectables(seq_elem_types)[source]
selectables()[source]
role(column, depth=0)[source]
columnCount(parent=<PyQt4.QtCore.QModelIndex object at 0x367e850>)[source]
columnIcon(column)[source]
columnToolTip(column)[source]
columnSize(column)[source]
pyData(index, role=0)[source]
data(index, role=0)[source]
flags(index)[source]
headerData(section, orientation, role=0)[source]
index(row, column, parent=<PyQt4.QtCore.QModelIndex object at 0x367e9d0>)[source]
parent(index)[source]
rowCount(parent=<PyQt4.QtCore.QModelIndex object at 0x367ea50>)[source]
hasChildren(parent=<PyQt4.QtCore.QModelIndex object at 0x367ead0>)[source]
class qarbon.qt.gui.basemodel.BaseProxyModel(parent=None)[source]

Bases: PyQt4.QtGui.QSortFilterProxyModel

A base Qt filter & sort model