WalkthroughMixin

class WalkthroughMixin()

Mixin class to provide walkthrough functionality.

Subclasses must implement get_current_view() and get_walkthrough_steps().

Signals:
walkthrough_finished (str, bool): Emitted when the walkthrough ends.
Parameters:
  • current_view (str): The name of the current view.

  • was_completed (bool): True if walkthrough finished successfully, False if exited early.

Public Methods

WalkthroughMixin.get_current_view() str

Abstract method to get the name of the current view.

Subclasses must override this to return the current view name.

Returns:

The name of the view currently displayed.

Return type:

str

Raises:

NotImplementedError – Always, unless overridden by a subclass.

WalkthroughMixin.get_walkthrough_steps() List[Tuple[str, str, str, Callable[[], QWidget | List[QWidget]]]]

Abstract method to retrieve the walkthrough steps for the current view.

Subclasses must override this to return a list of walkthrough steps, each a (title, description, view name, widget getter) tuple.

Returns:

The ordered walkthrough steps for this view.

Return type:

List[WalkthroughStep]

Raises:

NotImplementedError – Always, unless overridden by a subclass.

WalkthroughMixin.launch_walkthrough() None

Starts the walkthrough process from the appropriate view. Skips to the relevant section depending on the current view.

WalkthroughMixin.show_walkthrough_intro(current_view: str) None

Displays the initial tutorial intro dialog.

Parameters:

current_view (str) – Identifier of the current view.

Private Methods

WalkthroughMixin._advance_walkthrough_index() None

Increments the walkthrough index and moves to the next step, if available.

WalkthroughMixin._force_close_walkthrough_dialog() None

Forcefully closes the walkthrough dialog and emits a termination signal.

WalkthroughMixin._handle_walkthrough_done(steps_completed: int, *, is_pseudo: bool = False) None

Handles cleanup and transition after a walkthrough step or sequence.

Parameters:
  • steps_completed (int) – Number of steps completed in the walkthrough.

  • is_pseudo (bool) – True if the step was completed implicitly (e.g. view change).

WalkthroughMixin._init_walkthrough() None

Initializes walkthrough state and internal tracking variables.

WalkthroughMixin._reposition_dialog(event: QMoveEvent) None

Reposition the walkthrough dialog near the highlighted widget, avoiding overlap and staying within the main window.

Parameters:

event (QMoveEvent) – The move event that triggered the repositioning.

WalkthroughMixin._run_next_walkthrough_step() None

Executes the next step in the walkthrough, waiting for the correct view.