bec_widgets.utils.bec_list#

Classes#

BECList

List Widget that manages ListWidgetItems with associated widgets.

Module Contents#

class BECList(parent=None)#

Bases: qtpy.QtWidgets.QListWidget

List Widget that manages ListWidgetItems with associated widgets.

__contains__(key: str) bool#
add_widget_item(key: str, widget: qtpy.QtWidgets.QWidget)#

Add a widget to the list, mapping is associated with the given key.

Parameters:
  • key (str) – Key to associate with the widget.

  • widget (QWidget) – Widget to add to the list.

clear_widgets()#

Remove and destroy all widget items.

get_all_keys() list[str]#

Return all keys for managed widgets.

get_item(key: str) qtpy.QtWidgets.QListWidgetItem | None#

Return the QListWidgetItem for a given key.

get_item_for_widget(widget: qtpy.QtWidgets.QWidget) qtpy.QtWidgets.QListWidgetItem | None#

Return the QListWidgetItem associated with a given widget.

get_widget(key: str) qtpy.QtWidgets.QWidget | None#

Return the widget for a given key.

get_widget_for_item(item: qtpy.QtWidgets.QListWidgetItem) qtpy.QtWidgets.QWidget | None#

Return the widget associated with a given QListWidgetItem.

get_widgets() list[qtpy.QtWidgets.QWidget]#

Return all managed widgets.

remove_widget_item(key: str)#

Remove a widget by identifier key.

Parameters:

key (str) – Key associated with the widget to remove.