qt_screenshot
Captures a Qt window or widget identified by ref or semantic description, returning an image with optional downscaling and PNG/JPEG format.
Instructions
Take a screenshot of a window or any widget, identified by ref OR by description.
Identify the widget semantically instead of by ref, e.g. describe="Name goes here:"
(a label: captures the widget that holds it), describe="save the profile" (tooltip),
window_title="PIPE-1234" with class_name="QDockWidget" (a docked widget), or
object_name="nameEdit". Add instance (pid, id or window title of the app) when
several Qt apps are running.
Args:
ref: Widget ref from qt_snapshot/qt_find_widget. If nothing identifies a widget,
the active window is captured.
full_window: If True, captures the first visible top-level window.
max_width: Max width before downscaling (default 1920).
max_height: Max height before downscaling (default 1080).
format: Image format - 'png' or 'jpeg' (default 'png').
quality: JPEG quality 1-100 (default 80, ignored for PNG).
describe: Free-text description matched against text, titles, tooltip, what's-this,
status tip, accessible name, objectName, placeholder, QSS ... (fuzzy).
window_title: Fuzzy match on the top-level window title.
class_name: Qt class, subclasses match (e.g. 'QDockWidget').
object_name: objectName, supports * and ? wildcards.
search_fields: Limit describe to specific fields (see qt_find_widget).
expand: What to capture relative to the match: 'auto' (a matched label captures the
widget holding it; anything else captures itself), 'self', 'parent', 'buddy'
(the label's field) or 'window'.
index: Which ranked match to use (0 = best).
min_score: Minimum semantic match score 0-1.
Returns an image plus a note saying what was captured.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| index | No | ||
| expand | No | auto | |
| format | No | png | |
| quality | No | ||
| describe | No | ||
| instance | No | ||
| max_width | No | ||
| min_score | No | ||
| class_name | No | ||
| max_height | No | ||
| full_window | No | ||
| object_name | No | ||
| window_title | No | ||
| search_fields | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |