radioviz.tools.base_dock

Base dock widget for tool components.

This module provides the base class for creating dock widgets that can be used to display tool-specific interfaces within the application’s main window.

Classes

ToolDockWidget(title[, parent, controller])

Base class for tool dock widgets.

class radioviz.tools.base_dock.ToolDockWidget(title: str, parent: QWidget | None = None, controller: T_ToolController | None = None)[source]

Bases: QDockWidget, Generic[T_ToolController]

Base class for tool dock widgets.

This class provides the foundation for creating dockable widgets that can be associated with specific tools and controllers within the application.

Variables:
  • dock_position (Qt.DockWidgetArea) – Default position where the dock widget will be placed

  • initial_visibility (bool) – Whether the dock widget is initially visible

  • enable_for_window_type (SubWindowEnum) – SubWindowEnum value indicating which window types this dock is enabled for

  • event_emitted (Signal) – Signal emitted when an event occurs within the dock widget

Initialize the ToolDockWidget.

Parameters:
  • title (str) – Title of the dock widget

  • parent (QWidget, optional) – Parent widget

  • controller (ToolController, optional) – Controller associated with this dock widget

emit_event(event: str, payload: Any | None = None) None[source]

Emit an event signal.

Parameters:
  • event (str) – Name of the event to emit

  • payload (Any, optional) – Optional payload data to send with the event

generate_view_dock_action(parent: QWidget) QAction[source]

Generate a view action for the dock widget.

This method should be overridden by subclasses to create a QAction that can be used to show/hide the dock widget.

Parameters:

parent (QWidget) – Parent widget for the action

Returns:

A QAction for controlling the dock widget visibility

Return type:

QAction

handle_event(event: ToolEvent) None[source]

Handle an incoming event.

This method should be overridden by subclasses to implement specific event handling logic.

Parameters:

event (ToolEvent) – The event to handle

set_controller(controller: T_ToolController) None[source]

Set the controller for this dock widget.

Parameters:

controller (ToolController) – Controller to associate with this dock widget