diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2012-11-04 12:54:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-19 14:59:06 +0100 |
commit | c8ef32e2b6cded37a6854b94a281464c1b7a298b (patch) | |
tree | 3f88b1184ba65c1bfe51ffae52c5fd28d98c48ae /src/quick/items/qquickaccessibleattached_p.h | |
parent | 29152ec5208261e3d1ad8fa7de4d22efce3de813 (diff) |
Accessibility: Improve interface handling in Quick
This changes how interfaces are handled:
the QAccessibleQuickItem will simply subclass
all interfaces and dynamically return 0 or the
appropriate interface_cast.
This makes our implementation a lot more flexible.
To make use of the value interface, only a value
property is needed (together with a corresponding role).
Since the implementation of the interfaces became simpler,
the value interface and some text interface improvements
go along with the change.
Change-Id: I003ec3016d48d730a4acac467bce322167842f4d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'src/quick/items/qquickaccessibleattached_p.h')
-rw-r--r-- | src/quick/items/qquickaccessibleattached_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h index 74f486ae7d..a11f40c535 100644 --- a/src/quick/items/qquickaccessibleattached_p.h +++ b/src/quick/items/qquickaccessibleattached_p.h @@ -127,6 +127,18 @@ public: return obj->setProperty(propertyName, value); } + static QObject *findAccessible(QObject *object, QAccessible::Role role = QAccessible::NoRole) + { + while (object) { + QObject *att = QQuickAccessibleAttached::attachedProperties(object); + if (att && (role == QAccessible::NoRole || att->property("role").toInt() == role)) { + break; + } + object = object->parent(); + } + return object; + } + Q_SIGNALS: void roleChanged(); |