qt_attach
Inject the helper library into a running Qt process to start an automation session. Use the PID from qt_list_processes; ensure build matches, otherwise follow returned steps.
Instructions
Inject the helper library into a running Qt process and open a session.
Find the target pid with qt_list_processes first (only Qt processes are listed, each with its qt_version/arch/bitness). The build artifacts in .qt-commander/bin must match the target process: same Qt major (qt_major used in qt_build), same toolchain (msvc/mingw), same Debug/Release build type, same 64/32-bit — a mismatch makes injection fail with code 2002. A process that is already attached fails with 2006; detach first.
If the build has not been completed, this returns error code 2001 with the steps to follow (qt_detect_msvc_and_qt → AskUserQuestion → qt_build → qt_attach again); it does not build automatically.
Injection modifies the target process (loads a DLL, starts a local RPC thread/listener). If the target process exits, the session goes dead: operations then fail with connection/timeout errors — check qt_list_sessions and re-attach.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |