radioviz.services.action_descriptor

Action descriptor module for Qt-based applications.

This module provides an ActionDescriptor that creates descriptors for action states with automatic signal emission. It allows defining boolean properties that automatically emit Qt signals when their values change, making it easy to integrate with Qt’s signal-slot mechanism for UI updates.

Classes

ActionDescriptor([action_name, signal_name])

Descriptor for action state with automatic signal emission.

class radioviz.services.action_descriptor.ActionDescriptor(action_name: str | None = None, signal_name: str | None = None)[source]

Bases: object

Descriptor for action state with automatic signal emission.

This descriptor creates a property that automatically emits a Qt signal when its value changes. It’s designed to work with Qt’s signal-slot mechanism to enable dynamic UI updates based on action availability.

Variables:
  • action_name – The name of the action this descriptor manages

  • _signal_name – The name of the signal to emit when the action state changes

  • private_name – The internal private attribute name used to store the value

  • descriptor_name – The name of the descriptor as assigned in the class

Initialize the ActionDescriptor.

Parameters:
  • action_name (str or None) – The name of the action (if None, derived from descriptor name)

  • signal_name (str or None) – The name of the signal to emit (if None, derived from action name)

property signal_name: str

Get the signal name associated with this action.

Returns:

The name of the signal to emit

Return type:

str