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:
- 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.
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.
- 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.