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

a11y: Top-level item views don't have the application as accessible parent



    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.5.3, 6.6.0 Beta2, 6.7.0 FF
    • 5.15.8, 6.7.0 FF
    • None
    • Debian bookworm, qtbase self-compiled from git dev branch as of commit 4b7b5edf26b895932d0bee2d3315989c41c2d283

      Same behaviour already with Qt 5.15.8 as provided by Debian.
    • Linux/X11
    • 6ec35ff8c (dev), 08c1f77c9 (6.6), 96e01fac3 (6.5)


      While other top-level widgets (e.g. QWidget) correctly have the application as a parent in the accessible tree, item views (like QTreeView)
      that are created without a widget as parent do not report any parent.
      The application object still lists them as children, so the accessible tree is apparently incorrect.

      The attached sample program (based on the flattreeview example removed in ce13dc8c2f73408ce2897f4bd044560955e38145 ) can be used to reproduce this. It hits an assert that shows the issue.


      Steps to reproduce:

      1) build the attached sample program

      2) run it

      Actual result: an assert is triggered

      Expected result: The program should run fine.


      Alternative way to reproduce/analyze:

      After removing the asserts, the issue can also be manually inspected by e.g. using Accerciser (on Linux) to inspect the accessible tree.

      With the application object selected in accerciser's a11y hierarchy, typing the following in its IPython console shows that the application has the item view as a child at index 1, but that child does not have any parent set:


      In [1]: acc.name
      Out[1]: 'flattreeview'
      In [2]: acc.role
      Out[2]: <enum ATSPI_ROLE_APPLICATION of type Atspi.Role>
      In [3]: acc.get_child_at_index(1)
      Out[3]: <Atspi.Accessible object at 0x7f80888bcac0 (AtspiAccessible at 0x3df3250)>
      In [4]: acc.get_child_at_index(1).name
      Out[4]: ''
      In [5]: acc.get_child_at_index(1).role
      Out[5]: <enum ATSPI_ROLE_TREE of type Atspi.Role>
      In [6]: acc.get_child_at_index(1).parent
      In [7]: acc.get_child_at_index(1).parent == None
      Out[7]: True



        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
            michaelweghorn Michael Weghorn
            0 Vote for this issue
            2 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes