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

a11y: Scrollbar orientation not reported via AT-SPI (and other a11y APIs)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.11.0 FF
    • None
    • Debian testing, qtbase self-compiled from git dev as of 96f089dfb39241bdc39f54c9183c2912f2d17f3a
    • Linux/Wayland, Linux/X11

      Currently, the orientation of a QScrollBar (and other controls) is not reported on the accessibility level, even though corresponding states or attributes/properties exist in most platform accessibility APIs.

      Corresponding states/attributes in platform a11y APIs:

      • Linux/AT-SPI2: states ATSPI_STATE_HORIZONTAL [1] and
        ATSPI_STATE_VERTICAL [2]
      • Windows/UIA: UIA_OrientationPropertyId [3]
      • macOS: NSAccessibilityOrientation [4]
      • web/ARIA: "aria-orientation" attribute [5]

      Not reporting the orientation e.g. makes it hard for users of assistive technology to identify what orientation the scrollbar has, and thus also which keyboard shortcuts apply for changing the position (up/down key for vertical scrollbar, left/right for horizontal one).

      Sample steps to reproduce with AT-SPI2 on Linux:

      1. Build and run this sample application
        #include <QApplication>
        #include <QMainWindow>
        #include <QScrollArea>
        
        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
        
            QMainWindow w;
        
            QScrollArea* scrollArea = new QScrollArea(&w);
            w.setCentralWidget(scrollArea);
            w.resize(400, 400);
        
            QWidget* dummyWidget = new QWidget;
            dummyWidget->resize(10000, 10000);
            scrollArea->setWidget(dummyWidget);
        
            w.show();
        
            return a.exec();
        }
        
      1. start Accerciser Accessibility Explorer
      2. in Accerciser's treeview of the a11y hierarchy, select the object for the horizontal scrollbar
      3. in Accerciser's "Interface Viewer", check the "States" section

      Actual result:

      No "horizontal" state is reported.

      Expected result:

      The "horizontal" state should be reported for the horizontal scroll bar (and the vertical state for the vertical scrollbar).

      Further information:

      When using a similar program using GTK 3 or GTK 4 instead of Qt, the state is reported as expected.

      [1] https://gnome.pages.gitlab.gnome.org/at-spi2-core/libatspi/enum.StateType.html#horizontal
      [2] https://gnome.pages.gitlab.gnome.org/at-spi2-core/libatspi/enum.StateType.html#vertical
      [3] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
      [4] https://developer.apple.com/documentation/appkit/nsaccessibilityorientationNSAccessibilityOrientation
      [5] https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-orientation

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: