Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.3, 6.4.0
-
None
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.