Implement child instead of navigate in QAccessibleMainWindow.
Change-Id: I321ce4f8bb6e724db87a0419f890174b32cc1fe2 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
This commit is contained in:
parent
c3313fdd1c
commit
b8d702dc8e
@ -1634,6 +1634,15 @@ QVariant QAccessibleMainWindow::invokeMethod(QAccessible::Method /*method*/, int
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QAccessibleInterface *QAccessibleMainWindow::child(int index) const
|
||||
{
|
||||
QList<QWidget*> kids = childWidgets(mainWindow(), true);
|
||||
if (index < kids.count()) {
|
||||
return QAccessible::queryAccessibleInterface(kids.at(index));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int QAccessibleMainWindow::childCount() const
|
||||
{
|
||||
QList<QWidget*> 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<QWidget*> 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();
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user