Automation IDs in QML
Solved
QML and Qt Quick
-
In standard Qt Widgets, Windows Automation IDs are added to elements by default when using
.ui
files or when callingsetObjectName
for dynamic widgets. For QML elements, there does not seem to be such a construct. Is there a way to set the Windows automation ID for QML elements? -
Found the answer to this question myself: It is by setting the
objectName
property:Control { objectName: "myAutomationId" }
This will result in a
Group
automation element with automation IDmyAutomationId
.Found this by looking at https://github.com/faaxm/spix/blob/master/examples/RemoteCtrl/main.qml
-