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

a11y AT-SPI: "GetStringAtOffset" from AT-SPI text interface not supported

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.5.0 Beta1
    • 6.5
    • None
    • Debian testing, qtbase built from dev branch as of commit e8495fc86e81f79aac5837b261e8395133c13631
    • Linux/X11
    • 9ab11c726e (qt/qtbase/dev) 9ab11c726e (qt/tqtc-qtbase/dev)

    Description

      Besides "GetTextAtOffset", the AT-SPI text interface also has a similar method "GetStringAtOffset" (added in https://gitlab.gnome.org/GNOME/at-spi2-core/-/commit/56220f05bc8b7683911658e1a8aff4a1ab3cab8d ), which is apparently meant to be the "successor", since the use of "GetTextAtOffset" by clients has been deprecated along with the commit.
      However, Qt currently doesn't support it.

      Steps to reproduce:

      (s.a. QTBUG-105281 for a somewhat similar scenario that also includes a screencast)

      1) start Accerciser (https://wiki.gnome.org/Apps/Accerciser)

      2) build and run the "textedit" example from qtbase:

      $ qtbase/examples/widgets/richtext/textedit/textedit

      3) navigate to the example's text node in Accerciser's a11y treeview of the application
      4) call the corresponding method on the text interface

      In [70]: acc.queryText().getStringAtOffset(5, pyatspi.TEXT_GRANULARITY_WORD)
      

      Actual result:

      An error message is shown:

      In [70]: acc.queryText().getStringAtOffset(5, pyatspi.TEXT_GRANULARITY_WORD)
      ---------------------------------------------------------------------------
      Error                                     Traceback (most recent call last)
      /usr/lib/python3/dist-packages/pyatspi/__init__.py in <module>
      ----> 1 acc.queryText().getStringAtOffset(5, pyatspi.TEXT_GRANULARITY_WORD)
      
      /usr/lib/python3/dist-packages/pyatspi/text.py in getStringAtOffset(self, offset, type)
          523                 the object, delimited by the specified text granularity.
          524                 """
      --> 525                 ret = Atspi.Text.get_string_at_offset(self.obj, offset, type)
          526                 return textRangeToList(ret)
          527 
      
      Error: atspi_error: No such object path '/org/a11y/atspi/accessible/2147483675' (1)
      

      Expected result:

      No error, but essentially the same result as one gets when using the "GetTextAtOffset" method with a matching boundary type instead:

      In [71]: acc.queryText().getTextAtOffset(5, pyatspi.TEXT_BOUNDARY_WORD_START)
      Out[71]: ('DOCTYPE', 2, 9)
      

      Attachments

        For Gerrit Dashboard: QTBUG-105811
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes