pynaviz.qt.widget_list_selection#

Classes

ChannelList(model[, parent])

ChannelListModel(data)

A model to handle the list of channels with checkboxes.

DynamicSelectionListView

A QListView that allows dynamic selection of multiple items with checkboxes.

GroupedChannelList(channel_names, ...[, parent])

Dialog wrapping GroupedChannelTree for group-by channel visibility.

GroupedChannelTree(channel_names, ...[, parent])

A tree widget showing channels nested under their group labels.

class pynaviz.qt.widget_list_selection.ChannelList(model, parent=None)[source]#

Bases: QDialog

Parameters:
checkStateChanged#

A dialog listing selectable channels (e.g., for visibility toggling).

Parameters:
  • model (ChannelListModel) – Data model that holds the list of channel states.

  • parent (QWidget, optional) – Parent widget.

staticMetaObject = PySide6.QtCore.QMetaObject("ChannelList" inherits "QDialog": Methods:   #41 type=Signal, signature=checkStateChanged(int), parameters=int )#
class pynaviz.qt.widget_list_selection.ChannelListModel(data)[source]#

Bases: QAbstractListModel

A model to handle the list of channels with checkboxes.

Parameters:

data (Any)

checkStateChanged#
data(index, role=None)[source]#

What to display in the list view.

flags(index)[source]#

Flags that determines what one can do with the items.

rowCount(parent=None)[source]#
setData(index, value, role)[source]#

Write data to the model.

Parameters:
  • index (QModelIndex) – The index of the item to modify.

  • value (Any) – The new value to set.

  • role (Qt.ItemDataRole) – The role of the data to set.

staticMetaObject = PySide6.QtCore.QMetaObject("ChannelListModel" inherits "QAbstractListModel": Methods:   #76 type=Signal, signature=checkStateChanged(int), parameters=int )#
class pynaviz.qt.widget_list_selection.DynamicSelectionListView[source]#

Bases: QListView

A QListView that allows dynamic selection of multiple items with checkboxes.

on_check_state_changed(changed_row)[source]#
selectionCommand(index, event=None)[source]#
staticMetaObject = PySide6.QtCore.QMetaObject("DynamicSelectionListView" inherits "QListView": )#
class pynaviz.qt.widget_list_selection.GroupedChannelList(channel_names, groups_mapping, order_mapping, visibility_mapping, parent=None)[source]#

Bases: QDialog

Dialog wrapping GroupedChannelTree for group-by channel visibility.

Emits visibilityChanged(np.ndarray) — a bool array in _manager.index order — whenever any checkbox in the tree changes.

Parameters:
  • channel_names (list) – Ordered channel keys matching _manager.index.

  • groups_mapping (dict) – {channel_key: group_label_str}.

  • order_mapping (dict or None) – {channel_key: int} sort rank, or None if not sorted.

  • visibility_mapping (dict) – {channel_key: bool} initial visibility.

  • parent (QWidget, optional)

staticMetaObject = PySide6.QtCore.QMetaObject("GroupedChannelList" inherits "QDialog": Methods:   #41 type=Signal, signature=visibilityChanged(PyObject), parameters=PyObject )#
visibilityChanged#
class pynaviz.qt.widget_list_selection.GroupedChannelTree(channel_names, groups_mapping, order_mapping, visibility_mapping, parent=None)[source]#

Bases: QTreeWidget

A tree widget showing channels nested under their group labels.

Top-level items represent groups (tristate checkboxes); leaf items represent individual channels. Toggling a group propagates to all its children; toggling a leaf updates the parent’s tristate state.

Parameters:
  • channel_names (list) – Ordered channel keys matching _manager.index.

  • groups_mapping (dict) – {channel_key: group_label_str} — the metadata value used to group.

  • order_mapping (dict or None) – {channel_key: int} sort rank from _manager.data["order"]. When provided, channels within each group are shown in rank order.

  • visibility_mapping (dict) – {channel_key: bool} initial visibility state.

  • parent (QWidget | None)

staticMetaObject = PySide6.QtCore.QMetaObject("GroupedChannelTree" inherits "QTreeWidget": Methods:   #103 type=Signal, signature=visibilityChanged(PyObject), parameters=PyObject )#
visibilityChanged#