summaryrefslogtreecommitdiffstats
path: root/src/plugins/accessible/widgets/itemviews.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-09-15 21:41:54 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-19 12:06:13 +0200
commit76d0d1926466d42b1b25f0bac642c1e0f239074c (patch)
tree84397813957307cf1ac393ac29d045acc6e08846 /src/plugins/accessible/widgets/itemviews.h
parent3647a00d47fd774daccce9f143cc2046fb59099d (diff)
Add parent and child functions to QAccessibleInterface.
Stop the mis-use of navigate to find the parent. In order to make navigation straight forward parent and child functions are now part of QAccessibleInterface. This allows navigating the hierarchy of accessible objects without the 1-based indexes in the navigate function which lead to confusion. Eventually the support for Ancestor in navigate can be completely removed and forwarded in the windows bridge if needed. In addition default parameters for virtual children. This will make the transition smooth since it allows to remove the integer already. Change-Id: I278287ce17161f9fa46797ac244676778c859576 Reviewed-on: http://codereview.qt-project.org/5024 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/plugins/accessible/widgets/itemviews.h')
-rw-r--r--src/plugins/accessible/widgets/itemviews.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/plugins/accessible/widgets/itemviews.h b/src/plugins/accessible/widgets/itemviews.h
index d98180b254..c2b255b424 100644
--- a/src/plugins/accessible/widgets/itemviews.h
+++ b/src/plugins/accessible/widgets/itemviews.h
@@ -76,6 +76,8 @@ public:
int childCount() const;
int indexOfChild(const QAccessibleInterface *) const;
+ QAccessibleInterface *parent() const;
+ QAccessibleInterface *child(int index) const;
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
@@ -193,6 +195,8 @@ public:
QString text(Text t, int child) const;
void setText(Text t, int child, const QString &text);
+ QAccessibleInterface *parent() const;
+ QAccessibleInterface *child(int) const;
int navigate(RelationFlag relation, int m_index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
@@ -246,6 +250,8 @@ public:
QString text(Text t, int child) const;
void setText(Text t, int child, const QString &text);
+ QAccessibleInterface *parent() const;
+ QAccessibleInterface *child(int index) const;
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
@@ -287,11 +293,17 @@ public:
QString text(Text, int) const { return QString(); }
void setText(Text, int, const QString &) {}
- int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
+ QAccessibleInterface *parent() const {
+ return QAccessible::queryAccessibleInterface(view);
+ }
+ QAccessibleInterface *child(int) const {
+ return 0;
+ }
+ int navigate(RelationFlag relation, int, QAccessibleInterface **iface) const
{
- if (relation == QAccessible::Ancestor && index == 1) {
- *iface = QAccessible::queryAccessibleInterface(view);
- return 0;
+ if (relation == QAccessible::Ancestor) {
+ *iface = parent();
+ return *iface ? 0 : -1;
}
return -1;
}