aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/accessible
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/accessible')
-rw-r--r--src/quick/accessible/qaccessiblequicktableview.cpp32
-rw-r--r--src/quick/accessible/qaccessiblequicktableview_p.h39
-rw-r--r--src/quick/accessible/qquickaccessiblefactory.cpp4
3 files changed, 75 insertions, 0 deletions
diff --git a/src/quick/accessible/qaccessiblequicktableview.cpp b/src/quick/accessible/qaccessiblequicktableview.cpp
new file mode 100644
index 0000000000..63f9217b0f
--- /dev/null
+++ b/src/quick/accessible/qaccessiblequicktableview.cpp
@@ -0,0 +1,32 @@
+// Copyright (C) 2026 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:significant reason:default
+
+#include "qaccessiblequicktableview_p.h"
+
+#include <QtQuick/private/qquicktableview_p_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(accessibility)
+
+QAccessibleQuickTableView::QAccessibleQuickTableView(QQuickTableView *tableView)
+ : QAccessibleQuickFlickable(tableView)
+{
+}
+
+// The view holds the focus, but assistive technology follows the current cell.
+// Platforms that ask for the focused element, rather than taking it from the
+// focus event, find the delegate of that cell here.
+QAccessibleInterface *QAccessibleQuickTableView::focusChild() const
+{
+ if (auto *view = qobject_cast<QQuickTableView *>(object())) {
+ if (QQuickItem *item = QQuickTableViewPrivate::get(view)->accessibleFocusItem)
+ return QAccessible::queryAccessibleInterface(item);
+ }
+ return nullptr;
+}
+
+#endif // accessibility
+
+QT_END_NAMESPACE
diff --git a/src/quick/accessible/qaccessiblequicktableview_p.h b/src/quick/accessible/qaccessiblequicktableview_p.h
new file mode 100644
index 0000000000..7b26a986d2
--- /dev/null
+++ b/src/quick/accessible/qaccessiblequicktableview_p.h
@@ -0,0 +1,39 @@
+// Copyright (C) 2026 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:significant reason:default
+
+#ifndef QACCESSIBLEQUICKTABLEVIEW_H
+#define QACCESSIBLEQUICKTABLEVIEW_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qaccessiblequickflickable_p.h"
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(accessibility)
+
+class QQuickTableView;
+
+class Q_QUICK_EXPORT QAccessibleQuickTableView : public QAccessibleQuickFlickable
+{
+public:
+ QAccessibleQuickTableView(QQuickTableView *tableView);
+
+ QAccessibleInterface *focusChild() const override;
+};
+
+#endif // accessibility
+
+QT_END_NAMESPACE
+
+#endif // QACCESSIBLEQUICKTABLEVIEW_H
diff --git a/src/quick/accessible/qquickaccessiblefactory.cpp b/src/quick/accessible/qquickaccessiblefactory.cpp
index 3245398ce2..e053645d8c 100644
--- a/src/quick/accessible/qquickaccessiblefactory.cpp
+++ b/src/quick/accessible/qquickaccessiblefactory.cpp
@@ -10,10 +10,12 @@
#include "qaccessiblequicktextinput_p.h"
#include "qaccessiblequickflickable_p.h"
#include "qaccessiblequicklistview_p.h"
+#include "qaccessiblequicktableview_p.h"
#include "qaccessiblequickwindowcontainer_p.h"
#include <QtQuick/private/qquickflickable_p.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquicklistview_p.h>
+#include <QtQuick/private/qquicktableview_p.h>
#include <QtQuick/private/qquicktextedit_p.h>
#include <QtQuick/private/qquicktextinput_p.h>
#include <QtQuick/private/qquickwindowcontainer_p.h>
@@ -31,6 +33,8 @@ QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject
return new QAccessibleQuickTextInput(qobject_cast<QQuickTextInput *>(object));
if (classname == QLatin1String("QQuickListView"))
return new QAccessibleQuickListView(qobject_cast<QQuickListView *>(object));
+ if (classname == QLatin1String("QQuickTableView"))
+ return new QAccessibleQuickTableView(qobject_cast<QQuickTableView *>(object));
if (classname == QLatin1String("QQuickFlickable"))
return new QAccessibleQuickFlickable(qobject_cast<QQuickFlickable *>(object));
if (classname == QLatin1String("QQuickWindowContainer"))