TTkTreeWidgetItem🌶️

class TTkTreeWidgetItem(*args, parent: Self = None, expanded: bool = False, selected: bool = False, hidden: bool = False, icon: TTkString = None, childIndicatorPolicy: ChildIndicatorPolicy = 2, **kwargs)[source]🌶️

Bases: TTkAbstractItemModel

The TTkTreeWidgetItem class provides an item for use with the :py:class:’TTkTree’ convenience class.

Tree widget items are used to hold rows of information for tree widgets. Rows usually contain several columns of data, each of which can contain a TTkString label and an icon or a TTkWidget.

Items are usually constructed with a parent that is TTkTreeWidgetItem (for items on lower levels of the tree). For example, the following code constructs a top-level item to represent cities of the world, and adds a entry for Oslo as a child item:

cities = TTkWidgetItem(["Cities"])
osloItem = TTkWidgetItem(["Oslo"], parent=cities)

or

cities = TTkWidgetItem(["Cities"])
osloItem = TTkWidgetItem(["Oslo"]
cities.addChild(osloItem)

Slots🌶️

Methods🌶️

addChild(child)[source]🌶️
addChildren(children)[source]🌶️
child(index)[source]🌶️
childIndicatorPolicy()[source]🌶️
children()[source]🌶️
data(col, role=None)[source]🌶️
emitDataChanged()[source]🌶️
hasWidgets()[source]🌶️
height()[source]🌶️
icon(col)[source]🌶️
indexOfChild(child)[source]🌶️
isExpanded()[source]🌶️
isHidden()[source]🌶️
isSelected()[source]🌶️
removeChild(child)[source]🌶️
setChildIndicatorPolicy(policy)[source]🌶️
setExpanded(expand)[source]🌶️
setHidden(hide)[source]🌶️
setIcon(col, icon)[source]🌶️
setSelected(select)[source]🌶️
setTextAlignment(col, alignment)[source]🌶️
setTreeItemParent(parent)[source]🌶️
size()[source]🌶️
sortChildren(col, order)[source]🌶️
sortData(col)[source]🌶️
takeChild(index)[source]🌶️
takeChildren()[source]🌶️
textAlignment(col)[source]🌶️
widget(col, role=None)[source]🌶️

TTkTreeWidgetItem Attributes🌶️

dataChanged

heightChanged