spacr.qt.widgets.empty_state

EmptyState — reusable big “nothing here yet” panel with icon, title, subtitle, and an optional call-to-action button.

Used on screens whose primary content requires the user to first pick a source folder / open a database (annotate, make-masks) — instead of showing an empty grid or blank canvas we render this centered.

Classes

EmptyState

Centered vertical stack: icon → title → subtitle → CTA button.

Module Contents

class spacr.qt.widgets.empty_state.EmptyState(title: str = '', subtitle: str = '', icon: PySide6.QtGui.QIcon | None = None, cta_label: str = '', on_action: Callable[[], None] | None = None, parent: PySide6.QtWidgets.QWidget | None = None)[source]

Bases: PySide6.QtWidgets.QWidget

Centered vertical stack: icon → title → subtitle → CTA button.

Any element can be omitted by passing an empty string / None.

Parameters:
  • title – heading, in the page’s title weight. Omitted when empty.

  • subtitle – one or two sentences under the title saying what the reader can do about the emptiness. Omitted when empty.

  • icon – mark above the title. Omitted when None.

  • cta_label – caption for the action button. No button is built when this is empty, so a state with nothing to offer costs no widget rather than showing a disabled one.

  • on_action – called when that button is pressed. The action_triggered signal is emitted either way, so a host may connect to it instead.

  • parent – owning widget, or None.

Build the placeholder shown where content would be.

Parameters:
  • title – the headline.

  • subtitle – the sentence under it, saying what to do.

  • icon – an icon above the text, or None.

  • cta_label – the action button’s label; empty shows no button.

  • on_action – called when that button is pressed.

  • parent – parent widget, or None.

property cta_button: PySide6.QtWidgets.QPushButton | None[source]

The primary CTA button, or None when no cta_label was set.