Create an accessible element for the dialog box

Change-Id: Idced1409b7f069f044833e96ea5c31fab0807c63
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Sharad Sahu 2023-09-21 19:33:52 +05:30
parent 2e290e8f4b
commit c2031c6153
1 changed files with 28 additions and 24 deletions

View File

@ -10,36 +10,40 @@ Dialog {
height: 150
title: "WebAssembly Dialog box"
modal: true
Rectangle {
background: Rectangle {
width: parent.width * 0.8
height: parent.height * 0.4
color: "lightgray"
anchors.fill: parent
ColumnLayout {
spacing: 2
anchors.fill: parent
Accessible.role: Accessible.Dialog
Accessible.name: parent.title
Accessible.description: "The About Dialog box."
}
ColumnLayout {
spacing: 2
anchors.fill: parent
Label {
id: labelInfo
Layout.alignment: Qt.AlignCenter
text: "Accessibility Demo sample application developed in QML."
Accessible.role: Accessible.StaticText
horizontalAlignment: Text.AlignHCenter
Accessible.name: text
Accessible.description: "Purpose of this application."
wrapMode: Text.WordWrap
}
Label {
id: labelInfo
Layout.alignment: Qt.AlignCenter
text: "Accessibility Demo sample application developed in QML."
Accessible.role: Accessible.StaticText
horizontalAlignment: Text.AlignHCenter
Accessible.name: text
Accessible.description: "Purpose of this application."
wrapMode: Text.WordWrap
}
Button {
id: closeButton
text: "Close"
Layout.alignment: Qt.AlignCenter
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: "To close the About Dialog box."
onClicked: {
aboutDialog.close()
}
Button {
id: closeButton
text: "Close"
Layout.alignment: Qt.AlignCenter
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: "To close the About Dialog box."
onClicked: {
aboutDialog.close()
}
}
}