[Interest] How to set UI Automation properties (AutomationId, name or classname) for QListView items?

Jorge Bustamante jorge at vsee.com
Thu May 20 21:40:54 CEST 2021


Hi all,

A team that uses our program that uses QT (widgets), is trying to run a UI
Automation script on our program. They require that each UI element have
either an AutomationId, a name or a classname property set. I am using
Windows Inspect tool to validate this.

I am able to set a classname to mostly all objects simply by making sure
that Meta Object Compiler is doing its job by including Q_OBJECT macro to
each class deriving from QObject directly or indirectly.

I am also able to set a name, for instance to a QListView object
(ControlType UIA_ListControlTypeId is shown on Inspect tool) by calling
its setAccessibleName().

However, I am not able to access the QListView items (ControlType
UIA_ListItemControlTypeId on Inspect tool) so that I can call
setAccessibleName() or set its classname or AutomationId somehow.

Any suggestions on how to set either name, classname or AutomationId to
items created dynamically on a QListView object?

Jorge Bustamante
Sr. Software Engineer
VSee: jorge at vsee.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210520/5ce8a136/attachment.html>


More information about the Interest mailing list