easymodel.treemodel

This module provides a generic interface for tree models

It centers around the TreeModel, which is used for all kinds of trees. The tree gets customized by the TreeItems. Each TreeItem holds a specific ItemData subclass. The ItemData is responsible for delivering the data. Make sure that all TreeItems in one hierarchy have the same ItemData subclasses or at least the same column_count. If not, make sure the data method can handle columns outside their column count. If you want to create a tree, create the needed itemdata classes, create a root tree item that is parent for all top-level items. The root item does not have to provide data, so the data might be None. It is advides to use ListItemData because the data in the list will be used for the headers. Then create the tree items with their appropriate data instances. Finally create a tree model instance with the root tree item.

Classes

ItemData An abstract class that holds data and is used as an interface for TreeItems
ListItemData(liste[, editable]) Item data for generic lists
TreeItem(data[, parent]) General TreeItem
TreeModel(root[, parent]) A tree model that uses the TreeItem to represent a general tree.

Data

INTERNAL_OBJ_ROLE QtCore.Qt.ItemDataRole to retrieve the object stored by the item data.
TREEITEM_ROLE QtCore.Qt.ItemDataRole to retrieve the TreeItem index.
easymodel.treemodel.INTERNAL_OBJ_ROLE = PySide.QtCore.Qt.ItemDataRole.UserRole

QtCore.Qt.ItemDataRole to retrieve the object stored by the item data. Can be used on any column. See: ItemData.internal_data().

easymodel.treemodel.TREEITEM_ROLE = 33

QtCore.Qt.ItemDataRole to retrieve the TreeItem index. Can be used on any column.