Sharad Sahu 13c3fd959e wasm: Work on wasm accessibility elements and events
Implement a11y support by adding html elements (Toolbar, Menu,
DialogBox) and events of the appropriate type and/or with the
appropriate ARIA attribute behind the canvas.

Pick-to: 6.5
Change-Id: If9c9fbff9a451b44e57de5d8834f4a78f33f41bc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-27 14:30:25 +00:00

64 lines
1.6 KiB
C++

// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "tabswidget.h"
GeneralTab::GeneralTab(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout();
layout->setSizeConstraint(QLayout::SetMaximumSize);
layout->addWidget(new QLabel("This is a text label"));
QPushButton *btn = new QPushButton("This is a push button");
layout->addWidget(btn);
connect(btn, &QPushButton::released, this, [=] () {
btn->setText("You clicked me");
});
layout->addWidget(new QCheckBox("This is a check box"));
layout->addWidget(new QRadioButton("Radio 1"));
layout->addWidget(new QRadioButton("Radio 2"));
QSlider *slider = new QSlider(Qt::Horizontal);
slider->setTickInterval(10);
slider->setTickPosition(QSlider::TicksAbove);
layout->addWidget(slider);
QSpinBox *spin = new QSpinBox();
spin->setValue(10);
spin->setSingleStep(1);
layout->addWidget(spin);
layout->addStretch();
QScrollBar *scrollBar = new QScrollBar(Qt::Horizontal);
scrollBar->setFocusPolicy(Qt::StrongFocus);
layout->addWidget(scrollBar);
setLayout(layout);
}
EditViewTab::EditViewTab(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout();
layout->setSizeConstraint(QLayout::SetMaximumSize);
textEdit = new QPlainTextEdit();
textEdit->setPlaceholderText("Enter Text here");
layout->addWidget(textEdit);
setLayout(layout);
}
void EditViewTab::showEvent( QShowEvent* event ) {
if (!b_connected)
{
emit connectToToolBar();
b_connected=true;
}
QWidget::showEvent( event );
}