-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.11.0 FF
-
None
-
Debian testing, qtbase self-compiled from git dev as of 96f089dfb39241bdc39f54c9183c2912f2d17f3a
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:
- 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(); }
- start Accerciser Accessibility Explorer
- in Accerciser's treeview of the a11y hierarchy, select the object for the horizontal scrollbar
- 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 |
681225,3 | a11y: Introduce accessible attribute for orientation | dev | qt/qtbase | Status: NEW | 0 | 0 |
681226,2 | a11y: Report QAbstractSlider orientation | dev | qt/qtbase | Status: NEW | 0 | 0 |
681232,1 | a11y: Report QQuickScrollBar orientation | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |
681486,5 | a11y uia: Report orientation via UIA_OrientationPropertyId | dev | qt/qtbase | Status: NEW | 0 | 0 |
681516,2 | a11y macOS: Report orientation via NSAccessibilityOrientation | dev | qt/qtbase | Status: NEW | 0 | 0 |
681544,2 | a11y wasm: Report orientation via "aria-orientation" | dev | qt/qtbase | Status: NEW | +2 | 0 |