Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Accessibility/Linux] Checkable QPushButton announced as "check box" instead of "toggle button"

[Accessibility/Linux] Checkable QPushButton announced as "check box" instead of "toggle button"

Scheduled Pinned Locked Moved Unsolved General and Desktop
toggle buttonaccessibilityrolelinux
4 Posts 2 Posters 122 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mukthar
    wrote last edited by
    #1

    Hi,

    On Linux, a checkable QPushButton is announced by Orca as "check box"
    instead of "toggle button". On Windows, NVDA correctly says "toggle button".

    Root Cause

    QAccessibleButton::role() returns QAccessible::CheckBox for any checkable
    button. The AT-SPI2 bridge maps this to ATSPI_ROLE_CHECK_BOX.
    However, ATSPI_ROLE_TOGGLE_BUTTON exists in AT-SPI2 but Qt never uses it.

    On Windows it works because IToggleProvider is attached to any element
    with state().checkable = true, and screen readers announce it as
    "toggle button" from that.

    Reproducer

    QPushButton btn("Mute");
    btn.setCheckable(true);
    // Linux/Orca → "check box"  
    // Windows/NVDA → "toggle button" 
    

    Is there a QTBUG for this?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi,

      For the bugs, you should check the bug report system.

      That said, I think it will partly depend on the version of AT-SPI2 used to build Qt. When using more recent versions, I think the text will be associated with ATSPI_ROLE_SWITCH. If that is not the case, then the button is associated with a check box role.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mukthar
        wrote last edited by
        #3

        I found that Qt 6.11 already addresses this with a new
        QAccessible::Switch role (commit 293032a) mapped to
        ATSPI_ROLE_SWITCH on Linux and UIA_ButtonControlTypeId on Windows,
        which is the proper long-term fix.

        For 6.10.x, a backport patch in getRole() in atspiadaptor.cpp
        seems like a reasonable workaround:

        if (interface->role() == QAccessible::Button 
                && interface->state().checkable)
            return ATSPI_ROLE_TOGGLE_BUTTON;
        

        Would such a patch be acceptable for 6.10.x, or is the
        recommendation to upgrade to 6.11?

        1 Reply Last reply
        2
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote last edited by
          #4

          I think 6.10 is arriving to an end but it would be worth asking on the submission that introduced the fix.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved