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

a11y: AT-SPI selection interface not supported

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.5.0 Beta1
    • 6.5
    • None
    • Linux/Wayland, Linux/X11
    • ece2feee03 (qt/qtbase/dev) ece2feee03 (qt/tqtc-qtbase/dev)

    Description

      AT-SPI has a Selection interface that allows exposing selection information and changing selections via assistive technology.
      Doc: https://lazka.github.io/pgi-docs/Atspi-2.0/classes/Selection.html

      However, Qt currently does not implement this interface or provide any means for Qt applications to expose selections to assistive technology.

      One use case where I ran into this is that the Orca screen reader on Linux does not announce selected cells in the Qt 6 based UI variant of LibreOffice.

      I plan to suggest a potential implementation and will then also add a demo screencast for the LibreOffice case, but there are many more use cases and I think that some of Qt's own widgets would also profit from being extended to expose selection information to assistive technology.

      Microsoft's UIA also has a means to handle selection that could be covered in addition to AT-SPI. (FWIW, IAccessible that is no longer used by Qt also supports selection via IAccessible::get_accSelection.)

      Sample steps to reproduce

      1) start LibreOffice Calc in the Qt 6 based variant of LibreOffice Writer

      2) select a few cells
      3) start Accerciser ( https://gitlab.gnome.org/GNOME/accerciser )
      4) in Accerciser's treeview of LibreOffice's a11y object hierarchy, navigate to the a11y object for the spreadsheet
      5) query the supported interfaces and explicitly try to query the Selection interface:

      In [1]: acc.get_interfaces()
      Out[1]: ['Accessible', 'Component', 'Table']
      In [2]: acc.querySelection()
      ---------------------------------------------------------------------------
      NotImplementedError                       Traceback (most recent call last)
      /usr/lib/python3/dist-packages/pyatspi/__init__.py in <module>
      ----> 1 acc.querySelection()
      
      /usr/lib/python3/dist-packages/pyatspi/Accessibility.py in <lambda>(x)
          149 Atspi.Accessible.queryHypertext = lambda x: Hypertext(getInterface(Atspi.Accessible.get_hypertext_iface, x))
          150 Atspi.Accessible.queryImage = lambda x: Image(getInterface(Atspi.Accessible.get_image_iface, x))
      --> 151 Atspi.Accessible.querySelection = lambda x: Selection(getInterface(Atspi.Accessible.get_selection_iface, x))
          152 Atspi.Accessible.queryTable = lambda x: Table(getInterface(Atspi.Accessible.get_table_iface, x))
          153 Atspi.Accessible.queryTableCell = lambda x: TableCell(getInterface(Atspi.Accessible.get_table_cell, x))
      
      /usr/lib/python3/dist-packages/pyatspi/Accessibility.py in getInterface(func, obj)
           66         if ret:
           67                 return ret
      ---> 68         raise NotImplementedError
           69 
           70 def getEventType(event):
      
      NotImplementedError: 
      

      Actual result:

      The AT-SPI selection interface is not supported and there seems to be no way for LibreOffice to fix that without adding corresponding API to the Qt library.

      Expected result:

      There should be a way to expose the AT-SPI selection interface in Qt applications (and ideally, some of the Qt widgets should expose it, too).

      Attachments

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

        Activity

          People

            smd Jan Arve
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes