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

[Accessibility] QtQuick.Controls Accessibility.StaticText not used by screen reader (Narrator)

    XMLWordPrintable

Details

    • Windows

    Description

      Hello, I have encountered strange behaviour  when trying to use check accessibility in QML Controls in Qt6.

      Sample code:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.15
      import QtQuick.Layouts 1.15
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("QML Accessibility Test")
      
          ColumnLayout {
              anchors.fill: parent
              Label {
                  text: "QML Label as StaticText"
                  Accessible.role: Accessible.StaticText
                  Accessible.name: text
                  Accessible.focusable: true
                  Accessible.ignored: false
              }
              Label {
                  text: "QML Label as EditableText"
                  Accessible.role: Accessible.EditableText
                  Accessible.name: text
                  Accessible.focusable: true
                  Accessible.ignored: false
              }
              Text {
                  text: "QML Text as StaticText"
                  Accessible.role: Accessible.StaticText
                  Accessible.name: text
                  Accessible.focusable: true
                  Accessible.ignored: false
              }
              Text {
                  text: "QML Text as EditableText"
                  Accessible.role: Accessible.EditableText
                  Accessible.name: text
                  Accessible.focusable: true
                  Accessible.ignored: false
              }
          }
      }
      
      

      Behaviour under Qt 5.15:

      When running Windows Narrator, all elements have their name correctly read out during when running mouse over them.

      Behaviour under Qt 6.x:

      When running Windows Narrator, all only the last element Text/EditableText is read out.

      No matter what role I set inside Label, it's never read aloud. If I use StaticText on any Control, it's never read aloud.

      I have tried checking properties in Accessiblity Insights for Windows, and it seems like Label is always set to role StaticText - no matter what I specify in Accessibility.role. This behaviour is the same in Qt5 & Qt6.

      Furthermore, I've tried reproducing the same issue under QtWidgets/Label, and it works as expected in there.

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            rdosek Roman Dosek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes