TreeCategoryDelegate#

class omni.kit.browser.core.TreeCategoryDelegate(hide_zero_count: bool = False, *args, **kwargs)#

Bases: CategoryDelegate

Delegate to represent category items in a hierarchical structure.

Kwargs:

hide_zero_count (bool): Hide category count if count is 0. Default False.

Methods

__init__(self)

Constructs AbstractItemDelegate.

build_branch(model, item[, column_id, ...])

Create a branch widget that opens or closes subtree

build_widget(model, item[, index, level, ...])

Create a widget per category item

draw_expanded_symbol(expanded)

Draw the symbol indicating the expanded state for a category item.

get_label(item)

Return the label for a CategoryItem by splitting the item name and taking the last segment in uppercase.

__init__(
self: omni.ui._ui.AbstractItemDelegate,
) None#

Constructs AbstractItemDelegate.

`kwargsdict`

See below

### Keyword Arguments:

build_branch(
model: AbstractItemModel,
item: CategoryItem,
column_id: int = 0,
level: int = 0,
expanded: bool = False,
)#

Create a branch widget that opens or closes subtree

Parameters:
  • model (ui.AbstractItemModel) – Category data model.

  • item (CategoryItem) – Category item.

  • column_id (int) – ignore.

  • level (int) – Level of the hierarchy the current item is at, from 0 to n.

  • expanded (bool) – Indicates whether child categories are displayed expanded.

build_widget(
model: AbstractItemModel,
item: CategoryItem,
index: int = 0,
level: int = 0,
expanded: bool = False,
)#

Create a widget per category item

Parameters:
  • model (ui.AbstractItemModel) – Category data model.

  • item (CategoryItem) – Category item.

  • index (int) – ignore.

  • level (int) – ignore.

  • expanded (bool) – ignore.

draw_expanded_symbol(expanded: bool) None#

Draw the symbol indicating the expanded state for a category item.

Parameters:

expanded (bool) – Flag indicating if the category item is expanded.

get_label(
item: CategoryItem,
) str#

Return the label for a CategoryItem by splitting the item name and taking the last segment in uppercase.

Parameters:

item (CategoryItem) – Category item.

Returns:

The processed label string.

Return type:

str