summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/a11y/basic_widgets/main.cpp
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2022-06-09 13:10:03 +0200
committerMorten Sørvig <morten.sorvig@qt.io>2022-07-06 17:56:58 +0200
commit9be0f2945d404ceb743e4805f7df388c7fd039f1 (patch)
tree652ea4510f4b1a3ce674364063d4f1b0877ccfb7 /tests/manual/wasm/a11y/basic_widgets/main.cpp
parent25c2d05340eee01cf55457b8327f8f69d408879a (diff)
wasm: begin work on accessibility backend
Implement a11y support by adding html elements of the appropriate type and/or with the appropriate ARIA attribute behind the canvas. Also add a simple manual-test. Change-Id: I2898fb038c1d326135a1341cdee323bc964420bb Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'tests/manual/wasm/a11y/basic_widgets/main.cpp')
-rw-r--r--tests/manual/wasm/a11y/basic_widgets/main.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/manual/wasm/a11y/basic_widgets/main.cpp b/tests/manual/wasm/a11y/basic_widgets/main.cpp
new file mode 100644
index 00000000000..78f142bc1e3
--- /dev/null
+++ b/tests/manual/wasm/a11y/basic_widgets/main.cpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtWidgets>
+
+class BasicA11yWidget: public QWidget
+{
+public:
+ BasicA11yWidget() {
+
+ QVBoxLayout *layout = new QVBoxLayout();
+
+ layout->addWidget(new QLabel("This is a text label"));
+ layout->addWidget(new QPushButton("This is a push button"));
+ layout->addWidget(new QCheckBox("This is a check box"));
+
+ // TODO: Add more widgets
+
+ layout->addStretch();
+
+ setLayout(layout);
+ }
+};
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ BasicA11yWidget a11yWidget;
+ a11yWidget.show();
+
+ return app.exec();
+}