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 215 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 7 Nov 2024, 14:27 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 8 Nov 2024, 11:13 last edited by Aristotle 11 Aug 2024, 11:50
      #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 8 Nov 2024, 11:13

      1/2

      7 Nov 2024, 14:27

      • Login

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