aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSharad Sahu <sharad.sahu@crossware.io>2023-07-07 10:56:14 +0530
committerSharad Sahu <sharad.sahu@crossware.io>2023-07-07 11:07:06 +0000
commit1fa3c386df152bc54bf5feef41c23080c3d24c22 (patch)
treeadfc2480f0609c048f1d23443efbf17e0bf5e4be
parente9f631b09265f575575038f6979443143e2121c0 (diff)
To include the Menu and Toolbar in the ApplicationWindow
Change-Id: I487863ebfe85f5a8f2baffe8c89cc8f9f85b5e3c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--tests/manual/wasm/a11y/qml_basic_item/CMakeLists.txt2
-rw-r--r--tests/manual/wasm/a11y/qml_basic_item/WasmMenu.qml34
-rw-r--r--tests/manual/wasm/a11y/qml_basic_item/WasmToolBar.qml33
-rw-r--r--tests/manual/wasm/a11y/qml_basic_item/main.qml29
4 files changed, 81 insertions, 17 deletions
diff --git a/tests/manual/wasm/a11y/qml_basic_item/CMakeLists.txt b/tests/manual/wasm/a11y/qml_basic_item/CMakeLists.txt
index ec8453bef4..509bf7c5fd 100644
--- a/tests/manual/wasm/a11y/qml_basic_item/CMakeLists.txt
+++ b/tests/manual/wasm/a11y/qml_basic_item/CMakeLists.txt
@@ -21,6 +21,8 @@ qt_internal_add_manual_test(qml_basic_item
# Resources:
set(qmake_immediate_resource_files
"main.qml"
+ "WasmMenu.qml"
+ "WasmToolBar.qml"
)
qt6_import_qml_plugins(qml_basic_item INCLUDE Qt::QtQuick2Plugin)
diff --git a/tests/manual/wasm/a11y/qml_basic_item/WasmMenu.qml b/tests/manual/wasm/a11y/qml_basic_item/WasmMenu.qml
new file mode 100644
index 0000000000..eee839fdcc
--- /dev/null
+++ b/tests/manual/wasm/a11y/qml_basic_item/WasmMenu.qml
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+MenuBar {
+ Accessible.role: Accessible.MenuBar
+ Menu {
+ title: "&Chrono"
+ MenuItem {
+ text: "&Date"
+ Accessible.role: Accessible.MenuItem
+ Accessible.name: text
+ Accessible.description: text
+ }
+ MenuItem {
+ text: "&Time"
+ Accessible.role: Accessible.MenuItem
+ Accessible.name: text
+ Accessible.description: text
+ }
+ }
+ Menu {
+ title: "&Help"
+
+ MenuItem {
+ text: "&about"
+ Accessible.role: Accessible.MenuItem
+ Accessible.name: text
+ Accessible.description: text
+ }
+ }
+}
diff --git a/tests/manual/wasm/a11y/qml_basic_item/WasmToolBar.qml b/tests/manual/wasm/a11y/qml_basic_item/WasmToolBar.qml
new file mode 100644
index 0000000000..d0c385bb91
--- /dev/null
+++ b/tests/manual/wasm/a11y/qml_basic_item/WasmToolBar.qml
@@ -0,0 +1,33 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ToolBar {
+
+ RowLayout {
+
+ spacing: 10
+ Accessible.role: Accessible.ToolBar
+
+ ToolButton {
+ text: qsTr("C&opy")
+ Accessible.role: Accessible.Button
+ Accessible.name: text
+ Accessible.description: text
+ }
+ ToolButton {
+ text: qsTr("C&ut")
+ Accessible.role: Accessible.Button
+ Accessible.name: text
+ Accessible.description: text
+ }
+ ToolButton {
+ text: qsTr("&Paste")
+ Accessible.role: Accessible.Button
+ Accessible.name: text
+ Accessible.description: text
+ }
+ }
+}
diff --git a/tests/manual/wasm/a11y/qml_basic_item/main.qml b/tests/manual/wasm/a11y/qml_basic_item/main.qml
index a32f52188e..1586b8adfd 100644
--- a/tests/manual/wasm/a11y/qml_basic_item/main.qml
+++ b/tests/manual/wasm/a11y/qml_basic_item/main.qml
@@ -1,6 +1,5 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
import QtQuick
import QtQuick.Window
import QtQuick.Controls
@@ -10,24 +9,21 @@ ApplicationWindow {
width: 640
height: 480
- Text {
- id: headerText
-
+ WasmMenu {
+ id: wasmMenu
anchors {
- top: parent.top
- topMargin: 20
left: parent.left
- leftMargin: 20
+ top: parent.top
}
- width: 500
- height: 50
- font.pixelSize: 30
- text: "QML Accessibility Tester"
- Accessible.role: Accessible.StaticText
- Accessible.name: text
- Accessible.description: text
}
+ WasmToolBar {
+ id: wasmToolbar
+ anchors {
+ top: wasmMenu.bottom
+ topMargin: 3
+ }
+ }
//Component which holds basic items of the qml for the purpose of accessibility testing
Rectangle {
@@ -36,7 +32,7 @@ ApplicationWindow {
anchors {
left: parent.left
leftMargin: 20
- top: headerText.bottom
+ top: wasmToolbar.bottom
topMargin: 10
}
radius: 5
@@ -48,8 +44,7 @@ ApplicationWindow {
id: textBox
width: 200
height: 30
- anchors
- {
+ anchors {
left: parent.left
leftMargin: 10
top: parent.top