napari_track_edit.application_menus.tracking_widget

Attributes

_TRACKING_TABS

Classes

TrackingWidget

Tab widget holding the different ways of creating tracks.

Functions

register_tracking_tab(name, widget_cls[, index]) → None

Register a widget class to appear as a tab in every TrackingWidget.

Module Contents

napari_track_edit.application_menus.tracking_widget._TRACKING_TABS: list[tuple[str, type[qtpy.QtWidgets.QWidget]]]
napari_track_edit.application_menus.tracking_widget.register_tracking_tab(name: str, widget_cls: type[qtpy.QtWidgets.QWidget], index: int | None = None) → None

Register a widget class to appear as a tab in every TrackingWidget.

Meant to be called once at import time by a package that wants to contribute a way of creating tracks. The widget class must accept a single viewer: napari.Viewer argument, matching TrackingFromScratch.

If a tab with this name is already registered, it is replaced in place rather than duplicated. index is ignored when replacing.

Parameters:
  • name (str) – The tab’s display name.

  • widget_cls (type[QWidget]) – Widget class to instantiate per TrackingWidget, called as widget_cls(viewer).

  • index (int | None) – Position to insert a new tab at. Defaults to appending after all previously registered tabs. Ignored if name already exists.

class napari_track_edit.application_menus.tracking_widget.TrackingWidget(viewer: napari.Viewer)

Bases: qtpy.QtWidgets.QTabWidget

Tab widget holding the different ways of creating tracks.

“Track from Scratch” (manual tracking) is always present; other tabs are contributed by downstream packages via register_tracking_tab() and appear in registration order.

tabs: dict[str, qtpy.QtWidgets.QWidget]