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

Qt Quick Controls Button: Unable to override Accessible.role

    XMLWordPrintable

Details

    • 3c08d08ae (dev), d204cebca (6.5), 3e301a921 (tqtc/lts-6.2), c1d07c819 (tqtc/lts-5.15), bc3e74d01 (tqtc/lts-5.15)

    Description

      In the code below, even though we give the Button the role of "Accessible.RadioButton", it is still detected by the OS as a "regular" Button (as reported by Visual UIA Verify, Microsoft Narrator, or macOS VoiceOver).

      In contrast, the role is correctly applied to the Rectangle (see screenshot)

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      
      Window {
          width: 400
          height: 300
          visible: true
          title: qsTr("Accessibility Role Study")
      
          Column {
              Button {
                  text: "Button"
                  Accessible.role: Accessible.RadioButton
              }
              Rectangle {
                  objectName: "Rectangle"
                  width: 100
                  height: 50
                  color: "yellow"
                  Accessible.role: Accessible.RadioButton
              }
          }
      }
      

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: