tree_view ========= .. py:module:: qfluentwidgets.components.widgets.tree_view Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.widgets.tree_view.TreeItemDelegate qfluentwidgets.components.widgets.tree_view.TreeViewBase qfluentwidgets.components.widgets.tree_view.TreeWidget qfluentwidgets.components.widgets.tree_view.TreeView .. py:class:: TreeItemDelegate(parent: PyQt5.QtWidgets.QTreeView) Bases: :py:obj:`PyQt5.QtWidgets.QStyledItemDelegate` Tree item delegate .. py:attribute:: lightCheckedColor .. py:attribute:: darkCheckedColor .. py:method:: setCheckedColor(light, dark) set the color of indicator in checked status Parameters ---------- light, dark: str | QColor | Qt.GlobalColor color in light/dark theme mode .. py:method:: paint(painter, option, index) .. py:method:: initStyleOption(option, index) .. py:class:: TreeViewBase(*args, **kwargs) Tree view base class .. py:attribute:: scrollDelagate .. py:method:: setCheckedColor(light, dark) set the color in checked status Parameters ---------- light, dark: str | QColor | Qt.GlobalColor color in light/dark theme mode .. py:method:: drawBranches(painter, rect, index) .. py:method:: setBorderVisible(isVisible: bool) set the visibility of border .. py:method:: setBorderRadius(radius: int) set the radius of border .. py:class:: TreeWidget(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QTreeWidget`, :py:obj:`TreeViewBase` Tree widget .. py:method:: 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. .. py:class:: TreeView(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QTreeView`, :py:obj:`TreeViewBase` Tree view .. py:method:: 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.