tree_view

Module Contents

TreeItemDelegate

Tree item delegate

TreeViewBase

Tree view base class

TreeWidget

Tree widget

TreeView

Tree view

class TreeItemDelegate(parent: PyQt5.QtWidgets.QTreeView)

Bases: PyQt5.QtWidgets.QStyledItemDelegate

Tree item delegate

lightCheckedColor
darkCheckedColor
setCheckedColor(light, dark)

set the color of indicator in checked status

Parameters

light, dark: str | QColor | Qt.GlobalColor

color in light/dark theme mode

paint(painter, option, index)
initStyleOption(option, index)
class TreeViewBase(*args, **kwargs)

Tree view base class

scrollDelagate
setCheckedColor(light, dark)

set the color in checked status

Parameters

light, dark: str | QColor | Qt.GlobalColor

color in light/dark theme mode

drawBranches(painter, rect, index)
setBorderVisible(isVisible: bool)

set the visibility of border

setBorderRadius(radius: int)

set the radius of border

class TreeWidget(parent=None)

Bases: PyQt5.QtWidgets.QTreeWidget, TreeViewBase

Tree widget

viewportEvent(event)

Catch the click event to override the item “expand/collapse” function which is still called in the place it was before moving the branches in the drawBranches method.

class TreeView(parent=None)

Bases: PyQt5.QtWidgets.QTreeView, TreeViewBase

Tree view

viewportEvent(event)

Catch the click event to override the item “expand/collapse” function which is still called in the place it was before moving the branches in the drawBranches method.