Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140394

QAccessibleInterface::childAt() ignores "z" position of QQuickItems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.4, 6.9.2
    • None

      When trying to perform a hit test using QAccessibleInterface::childAt() to find out which QQuickItem is at a given screen position, "unexpected" z orders are ignored. Usually the test returns the last declared sibling, instead of considering their z properties.

      This can be tested when selecting accessible elements by tap on Android, or on iOS >= 18 when using my patch for QTBUG-140393.

      import QtQuick
      import QtQuick.Controls
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Button {
              id: hello
              text: "Hello"
              anchors.centerIn: parent
          }
      
          Button {
              text: "World"
              z: hello.z - 1
              anchors.centerIn: parent
          }
      }
      

      Here "World" will be selected, although it's visually below "Hello" due to the manually set "z" value.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            frank.osterfeld Frank Osterfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes