vcl/qt5/QtAccessibleWidget.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit b1039972969286bbbbaebb417b2632e1d0cbdad3
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Oct 28 18:18:15 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Oct 28 19:53:39 2025 +0100

    qt a11y: Report orientation
    
    If either the HORIZONTAL or VERTICAL a11y state
    are set, report the corresponding
    QAccessible::Attribute::Orientation attribute newly
    introduce in Qt's qtbase commit [1]
    
        commit b53656bfa70461a643ff564ff33eb2c049316e15
        Author: Michael Weghorn <[email protected]>
        Date:   Wed Oct 1 14:59:07 2025 +0200
    
            a11y: Introduce accessible attribute for orientation
    
    This e.g. shows the corresponding horizontal or
    vertical AT-SPI2 states in Accerciser's "Interface Viewer",
    section "States" for the horizontal and vertical toolbars
    in Writer when running with the qt6 VCL plugin and selecting
    the corresponding objects in Accerciser's treeview of the LO
    a11y hierarchy.
    
    [1] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=b53656bfa70461a643ff564ff33eb2c049316e15
    
    Change-Id: I03f062250949e0f6f8bd1717e2eeeb85790975bc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191734
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index ea44119d0934..41f14ab35ad5 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -957,6 +957,14 @@ QHash<QAccessible::Attribute, QVariant> 
QtAccessibleWidget::attributes() const
     aQtAttrs.insert(QAccessible::Attribute::Locale, aQLocale);
 #endif
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 11, 0)
+    const sal_Int64 nStates = xContext->getAccessibleStateSet();
+    if (nStates & css::accessibility::AccessibleStateType::HORIZONTAL)
+        aQtAttrs.insert(QAccessible::Attribute::Orientation, Qt::Horizontal);
+    else if (nStates & css::accessibility::AccessibleStateType::VERTICAL)
+        aQtAttrs.insert(QAccessible::Attribute::Orientation, Qt::Vertical);
+#endif
+
     Reference<XAccessibleExtendedAttributes> xAttributes(xContext, UNO_QUERY);
     if (!xAttributes.is())
         return aQtAttrs;

Reply via email to