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

Qt Quick Controls Button: Unable to override Accessible.role

    XMLWordPrintable

Details

    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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: