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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ref": "<ref>"
},
"name": "qt_trigger_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| action_text | No | ||
| action_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |