Automation IDs in QML
-
wrote on 7 Nov 2024, 14:27 last edited by
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? -
wrote on 8 Nov 2024, 11:13 last edited by Aristotle 11 Aug 2024, 11:50
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
-
1/2