summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-10-04 14:20:05 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-06 01:28:12 +0200
commit74448afd03ee93c8ecbd9d18995c9b7d1d652494 (patch)
tree0150abb415b9440ad49a13ced38dacef9ae26600 /src/plugins
parent454f6f43dc8c578bca8afa1aafd4965a869e6e58 (diff)
downloadqtbase-74448afd03ee93c8ecbd9d18995c9b7d1d652494.tar.gz
Use child/parent function in QAccessibleWidget and test.
This also uncovered a missing implementation of child for dock widgets. Change-Id: Iac4c5a51d4626769af11b277a9a345e1e31dc490 Reviewed-on: http://codereview.qt-project.org/5987 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp23
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.h2
2 files changed, 9 insertions, 16 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 22644aad2b..676d140eb0 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -1267,21 +1267,14 @@ QAccessibleDockWidget::QAccessibleDockWidget(QWidget *widget)
}
-int QAccessibleDockWidget::navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const
-{
- if (relation == Child) {
- if (entry == 1) {
- *iface = new QAccessibleTitleBar(dockWidget());
- return 0;
- } else if (entry == 2) {
- if (dockWidget()->widget())
- *iface = QAccessible::queryAccessibleInterface(dockWidget()->widget());
- return 0;
- }
- *iface = 0;
- return -1;
+QAccessibleInterface *QAccessibleDockWidget::child(int index) const
+{
+ if (index == 0) {
+ return new QAccessibleTitleBar(dockWidget());
+ } else if (index == 1 && dockWidget()->widget()) {
+ return QAccessible::queryAccessibleInterface(dockWidget()->widget());
}
- return QAccessibleWidget::navigate(relation, entry, iface);
+ return 0;
}
int QAccessibleDockWidget::childAt(int x, int y) const
@@ -1332,7 +1325,7 @@ QAccessible::State QAccessibleDockWidget::state(int child) const
return QAccessibleWidget::state(child);
}
-QRect QAccessibleDockWidget::rect (int child ) const
+QRect QAccessibleDockWidget::rect(int child) const
{
QRect rect;
bool mapToGlobal = true;
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.h b/src/plugins/accessible/widgets/qaccessiblewidgets.h
index 8d0a13a04a..b82df2f234 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.h
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.h
@@ -250,7 +250,7 @@ class QAccessibleDockWidget: public QAccessibleWidget
{
public:
explicit QAccessibleDockWidget(QWidget *widget);
- int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
+ QAccessibleInterface *child(int index) const;
int indexOfChild(const QAccessibleInterface *child) const;
int childCount() const;
QRect rect (int child ) const;