Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Automation IDs in QML
Forum Updated to NodeBB v4.3 + New Features

Automation IDs in QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 243 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aristotle
    wrote on last edited by
    #1

    In standard Qt Widgets, Windows Automation IDs are added to elements by default when using .ui files or when calling setObjectName 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?

    See AutomationElement.AutomationIdProperty.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Aristotle
      wrote on last edited by Aristotle
      #2

      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 ID myAutomationId.

      Found this by looking at https://github.com/faaxm/spix/blob/master/examples/RemoteCtrl/main.qml

      1 Reply Last reply
      1
      • A Aristotle has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved