TreeWidget

class cgp_generic_utils.qt.TreeWidget(**kwargs)

Bases: PySide2.QtWidgets.QTreeWidget

QTreeWidget with custom functionalities

childrenItems(recursive=False)

get the children items parented to the TreeWidget

Parameters:recursive (bool) – defines whether or not the command will get the children items recursively through hierarchy
Returns:list of children items
Return type:list[PySide2.QtWidgets.QTreeWidgetItem, cgp_generic_utils.qt.TreeWidgetItem]
clearSelection()

clear the selection of the QTreeWidgetItem

resizeToContent(margin=0)

resize the list of specified tre widgets to content

Parameters:margin (int) – margin within the columns