10#if QT_CONFIG(accessibility)
12QAccessibleQuickWidget::QAccessibleQuickWidget(QQuickWidget* widget)
13 : QAccessibleWidgetV2(widget)
22QAccessibleQuickWidget::~QAccessibleQuickWidget()
24 QObject::disconnect(m_connection);
27void QAccessibleQuickWidget::repairWindow()
29 if (!m_accessibleWindow || !m_accessibleWindow->object()) {
30 QQuickWidget *theWidget =
static_cast<QQuickWidget *>(object());
31 QQuickWindow *newOffscreen = QQuickWidgetPrivate::get(theWidget)->offscreenWindow;
34 if (qobject_cast<QQuickWindow *>(newOffscreen)) {
35 m_accessibleWindow.reset(
new QAccessibleQuickWindow(newOffscreen));
36 m_connection = QObject::connect(newOffscreen, &QObject::destroyed, theWidget,
37 [
this] { repairWindow(); });
42QAccessibleInterface *QAccessibleQuickWidget::child(
int index)
const
44 return m_accessibleWindow->child(index);
47int QAccessibleQuickWidget::childCount()
const
49 return m_accessibleWindow->childCount();
52int QAccessibleQuickWidget::indexOfChild(
const QAccessibleInterface *iface)
const
54 return m_accessibleWindow->indexOfChild(iface);
57QAccessibleInterface *QAccessibleQuickWidget::childAt(
int x,
int y)
const
59 return m_accessibleWindow->childAt(x, y);
62QAccessibleQuickWidgetOffscreenWindow::QAccessibleQuickWidgetOffscreenWindow(QQuickWindow *window)
63:QAccessibleQuickWindow(window)
68QAccessibleInterface *QAccessibleQuickWidgetOffscreenWindow::child(
int index)
const
74int QAccessibleQuickWidgetOffscreenWindow::childCount()
const
79int QAccessibleQuickWidgetOffscreenWindow::indexOfChild(
const QAccessibleInterface *iface)
const
85QAccessibleInterface *QAccessibleQuickWidgetOffscreenWindow::QAccessibleQuickWidgetOffscreenWindow::childAt(
int x,
int y)
const