GetQtProperty
string GetQtProperty(string control, string property)Description
Retrieves a Qt widget property by locating the corresponding UIAutomation element in the application, determining its screen coordinates and class type, and forwarding a GET request to the QtAgent.
If any lookup or communication step fails, the script is aborted and an error is logged.
Typical use cases
Reading the value of visual Qt widgets (e.g., text fields, checkboxes, labels).
Fetching state information not directly exposed by UIAutomation.
Accessing Qt-specific properties required for validations.
Notes
The function relies on UIAutomation to find the control by name.
A center point of the widget's bounding rectangle is used as coordinate reference for the QtAgent.
On any error (lookup failure, missing rectangle, communication issue, agent error), the method logs the failure and aborts the script.
Parameters
control - Name/identifier of the UI element to search for.
property - Property name to retrieve from the Qt widget.
Returns
string - The retrieved property value (payload from the QtAgent).
On failure the script is aborted and the return value is undefined.
Example
void main()
{
string text = GetQtProperty("TXT_USERNAME", "value");
Print("Username field contains: " + text);
}