qt_trigger_action
Trigger menu or toolbar actions in PySide6 applications by text or index to automate UI interactions for testing and debugging.
Instructions
Trigger a menu action or toolbar action by text or index.
Args:
ref: Ref to a QMenu, QMenuBar, QToolBar, or any widget with actions.
action_text: The action's display text (e.g., 'Save', '&Open').
Ampersands are stripped for matching.
action_index: The 0-based index of the action
(matching qt_menu_items order).
Provide either action_text or action_index (not both).
Use qt_menu_items first to see available actions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| action_text | No | ||
| action_index | No |