mafw.steering_gui.actions

Utility helpers for creating the steering GUI actions without duplicating wiring.

Author:

Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)

Description:

Share QAction definitions so the menu wiring stays clean.

Functions

create_action(parent, spec)

Instantiate a QAction from the provided ActionSpec.

Classes

ActionSpec(text, triggered[, shortcut, ...])

Describe the metadata needed to build a menu action.

class mafw.steering_gui.actions.ActionSpec(text: str, triggered: Callable[[], None], shortcut: StandardKey | str | None = None, status_tip: str | None = None, enabled: bool = True)[source]

Bases: object

Describe the metadata needed to build a menu action.

enabled: bool = True

Initial enabled state for the action.

shortcut: StandardKey | str | None = None

Optional QKeySequence.StandardKey or str describing the shortcut.

status_tip: str | None = None

Optional text for the status bar.

text: str

The label shown in the menu.

triggered: Callable[[], None]

Callback invoked when the user activates the action.

mafw.steering_gui.actions.create_action(parent: QObject, spec: ActionSpec) QAction[source]

Instantiate a QAction from the provided ActionSpec.