summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2012-01-19 14:20:54 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-06 10:15:09 +0100
commit1d18fd01645e3b9efcd1a2c5dd030a5fc0f5892a (patch)
tree84c4e4df3f91f80e07641a5a3b0b0cfcecbe6705 /src/gui
parentfdf9ee12916651c708dcd63d557e11e36ec7eb4e (diff)
Remove QAccessible::FocusChild, add focusChild()
Also cleanup (reduce) all implementations of navigate() in order to make the final removal of navigate smoother. Change-Id: I2c216db8f5b2e40afcce8f859fc775053adc2fe3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.cpp18
-rw-r--r--src/gui/accessible/qaccessible.h4
-rw-r--r--src/gui/accessible/qaccessibleobject.cpp25
-rw-r--r--src/gui/accessible/qaccessibleobject.h2
4 files changed, 26 insertions, 23 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 8610ef726d..b45c7e8d84 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -910,6 +910,16 @@ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > QAccessibleInterfa
}
/*!
+ Returns the object that has the keyboard focus.
+
+ The object returned can be any descendant, including itself.
+*/
+QAccessibleInterface *QAccessibleInterface::focusChild() const
+{
+ return 0;
+}
+
+/*!
\fn QAccessibleInterface *QAccessibleInterface::childAt(int x, int y) const
Returns the QAccessibleInterface of a child that contains the screen coordinates (\a x, \a y).
@@ -991,6 +1001,14 @@ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > QAccessibleInterfa
\sa relationTo(), childCount(), parent(), child()
*/
+int QAccessibleInterface::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
+{
+ Q_UNUSED(entry);
+ Q_UNUSED(relation);
+ *target = 0;
+ return -1;
+}
+
/*!
\fn QString QAccessibleInterface::text(QAccessible::Text t) const
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 202791caca..214ec20f9c 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -307,7 +307,6 @@ public:
enum RelationFlag {
Unrelated = 0x00000000,
- FocusChild = 0x00010000,
Label = 0x00020000,
Labelled = 0x00040000,
Controller = 0x00080000,
@@ -382,6 +381,7 @@ public:
// relations
virtual QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
virtual QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations() const;
+ virtual QAccessibleInterface *focusChild() const;
virtual QAccessibleInterface *childAt(int x, int y) const = 0;
@@ -390,7 +390,7 @@ public:
virtual QAccessibleInterface *child(int index) const = 0;
virtual int childCount() const = 0;
virtual int indexOfChild(const QAccessibleInterface *) const = 0;
- virtual int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const = 0;
+ virtual int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
// properties and state
virtual QString text(QAccessible::Text t) const = 0;
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp
index b9e0ac388b..d277f39c43 100644
--- a/src/gui/accessible/qaccessibleobject.cpp
+++ b/src/gui/accessible/qaccessibleobject.cpp
@@ -237,28 +237,13 @@ QAccessibleInterface *QAccessibleApplication::child(int index) const
return 0;
}
+
/*! \reimp */
-int QAccessibleApplication::navigate(QAccessible::RelationFlag relation, int,
- QAccessibleInterface **target) const
+QAccessibleInterface *QAccessibleApplication::focusChild() const
{
- if (!target)
- return -1;
-
- *target = 0;
- QObject *targetObject = 0;
-
- switch (relation) {
- case QAccessible::FocusChild:
- if (QWindow *window = QGuiApplication::activeWindow()) {
- *target = window->accessibleRoot();
- return 0;
- }
- break;
- default:
- break;
- }
- *target = QAccessible::queryAccessibleInterface(targetObject);
- return *target ? 0 : -1;
+ if (QWindow *window = QGuiApplication::activeWindow())
+ return window->accessibleRoot();
+ return 0;
}
/*! \reimp */
diff --git a/src/gui/accessible/qaccessibleobject.h b/src/gui/accessible/qaccessibleobject.h
index 2372e82f89..d035f17b1d 100644
--- a/src/gui/accessible/qaccessibleobject.h
+++ b/src/gui/accessible/qaccessibleobject.h
@@ -85,11 +85,11 @@ public:
// relations
int childCount() const;
int indexOfChild(const QAccessibleInterface*) const;
+ QAccessibleInterface *focusChild() const;
// navigation
QAccessibleInterface *parent() const;
QAccessibleInterface *child(int index) const;
- int navigate(QAccessible::RelationFlag, int, QAccessibleInterface **) const;
// properties and state
QString text(QAccessible::Text t) const;