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

Consider implementing isAccessibilitySelectorAllowed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4
    • None
    • macOS

    Description

      Some properties that are exposed through QMacAccessibilityElement are only relevant for certain element types/roles, but they are exposed regardless. You can see this by using Accessibility Inspector on a QSlider vs using it on a macOS slider and compare the difference. Attached is the screenshot of Accessibility Inspector for Screenshot macOS Slider.png and Screenshot QSlider.png . (Notice that QSlider has some cruft that only makes sense to text elements). Currently, the properties that are affected by this is:

      • accessibilityNumberOfCharacters
      • accessibilityVisibleCharacterRange
      • accessibilityInsertionPointLineNumber
      • accessibilitySelectedText
      • accessibilitySelectedTextRange

      This list will expand as we implement more specialized behavior (e.g. the table type will probably need to implement accessibilityRows, accessibilityColumns and accessibilityIndex, which are irrelevant for e.g. a slider).

      It turns out that this can be controlled by implementing

      isAccessibilitySelectorAllowed

      For reference, this is a simple implementation on how a basic implementation can be:

      - (BOOL)isAccessibilitySelectorAllowed:(SEL)selector {
          QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
          if (iface && iface->isValid()) {
              if (!iface->textInterface()
                      && (selector == @selector(accessibilityNumberOfCharacters)
                      || selector == @selector(accessibilityVisibleCharacterRange)
                      || selector == @selector(accessibilityInsertionPointLineNumber)
                      || selector == @selector(accessibilitySelectedText)
                      || selector == @selector(accessibilitySelectedTextRange))) {
                  return false;
              }
          }
          return true;
      }
      

       

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            smd Jan Arve
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes