From b8d702dc8e464bea4bff0c0e20035e03f7002299 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Sat, 22 Oct 2011 17:52:13 +0200 Subject: [PATCH] Implement child instead of navigate in QAccessibleMainWindow. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I321ce4f8bb6e724db87a0419f890174b32cc1fe2 Reviewed-by: Jan-Arve Sæther --- .../accessible/widgets/qaccessiblewidgets.cpp | 21 ++++++++----------- .../accessible/widgets/qaccessiblewidgets.h | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp index 1849fe1095..a79507b3ce 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp @@ -1634,6 +1634,15 @@ QVariant QAccessibleMainWindow::invokeMethod(QAccessible::Method /*method*/, int return QVariant(); } +QAccessibleInterface *QAccessibleMainWindow::child(int index) const +{ + QList kids = childWidgets(mainWindow(), true); + if (index < kids.count()) { + return QAccessible::queryAccessibleInterface(kids.at(index)); + } + return 0; +} + int QAccessibleMainWindow::childCount() const { QList kids = childWidgets(mainWindow(), true); @@ -1647,18 +1656,6 @@ int QAccessibleMainWindow::indexOfChild(const QAccessibleInterface *iface) const return childIndex == -1 ? -1 : ++childIndex; } -int QAccessibleMainWindow::navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const -{ - if (relation == Child && entry >= 1) { - QList kids = childWidgets(mainWindow(), true); - if (entry <= kids.count()) { - *iface = QAccessible::queryAccessibleInterface(kids.at(entry - 1)); - return *iface ? 0 : -1; - } - } - return QAccessibleWidget::navigate(relation, entry, iface); -} - int QAccessibleMainWindow::childAt(int x, int y) const { QWidget *w = widget(); diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.h b/src/plugins/accessible/widgets/qaccessiblewidgets.h index b82df2f234..c28f9b0f33 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.h +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.h @@ -299,13 +299,13 @@ class QAccessibleMainWindow : public QAccessibleWidget public: explicit QAccessibleMainWindow(QWidget *widget); - QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList ¶ms); + QAccessibleInterface *child(int index) const; int childCount() const; - int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const; int indexOfChild(const QAccessibleInterface *iface) const; int childAt(int x, int y) const; QMainWindow *mainWindow() const; + QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList ¶ms); }; #endif //QT_NO_MAINWINDOW