summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-07 16:06:22 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-16 14:28:11 +0200
commit679cd99f3d43ac624ad2683f6d3b1b97b3b2cb0d (patch)
tree8a39a3167a750456ec95ad8d73c5570f2c01f3d8 /src/platformsupport/linuxaccessibility/atspiadaptor.cpp
parent94f9c9678ac38f77be0e951ee582cc02bac458c1 (diff)
Accessibility: Update ComboBox text on arrow keys
Use ValueChanged to notify of changes in the ComboBox. On Linux we need to update name and then send selection-changed for Orca. Task-number: QTBUG-36814 Change-Id: Icdd34adddeac532476a6dd910d1e8bd33bcd590b Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'src/platformsupport/linuxaccessibility/atspiadaptor.cpp')
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 1ccab0a859..0fa1d96242 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -1024,15 +1024,28 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::ValueChanged: {
if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) {
QAccessibleInterface * iface = event->accessibleInterface();
- if (!iface || !iface->valueInterface()) {
- qWarning() << "ValueChanged event from invalid accessible: " << iface;
+ if (!iface) {
+ qWarning() << "ValueChanged event from invalid accessible.";
return;
}
-
- QString path = pathForInterface(iface);
- QVariantList args = packDBusSignalArguments(QLatin1String("accessible-value"), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("PropertyChange"), args);
+ if (iface->valueInterface()) {
+ QString path = pathForInterface(iface);
+ QVariantList args = packDBusSignalArguments(QLatin1String("accessible-value"), 0, 0, variantForPath(path));
+ sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
+ QLatin1String("PropertyChange"), args);
+ } else if (iface->role() == QAccessible::ComboBox) {
+ // Combo Box with AT-SPI likes to be special
+ // It requires a name-change to update caches and then selection-changed
+ QString path = pathForInterface(iface);
+ QVariantList args1 = packDBusSignalArguments(QLatin1String("accessible-name"), 0, 0, variantForPath(path));
+ sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
+ QLatin1String("PropertyChange"), args1);
+ QVariantList args2 = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(0))));
+ sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
+ QLatin1String("SelectionChanged"), args2);
+ } else {
+ qWarning() << "ValueChanged event and no ValueInterface or ComboBox: " << iface;
+ }
}
break;
}