diff options
author | Tomasz Olszak <olszak.tomasz@gmail.com> | 2014-03-26 00:26:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-04 08:33:16 +0200 |
commit | 790bc92bc0c3185971a74d231a8bfe1bbf0b2bd1 (patch) | |
tree | 9c6b110621d0fe056c0eb2c39cfe9edfaaae23d0 | |
parent | b1d6af35a45860ad9dfbd65979ca1df44abae446 (diff) |
Added handling of QT_LINUX_ACCESSIBILITY_ALWAYS_ON variable.
By setting this variable to non empty value we can, bypass
checking ScreenReaderEnabled proprty of org.a11y.Status
dbus interface. Not all accessibility readers set this.
The variable is also useful for debugging.
Change-Id: I6c5a1a51065948248e068dfff4755d6818ed9fb1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 9 | ||||
-rw-r--r-- | src/platformsupport/linuxaccessibility/dbusconnection.cpp | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index dffdfa889a..7713bcb358 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -97,6 +97,15 @@ QT_BEGIN_NAMESPACE Accessibility, and the Unix/X11 AT-SPI standard. Other backends can be supported using QAccessibleBridge. + In the Unix/X11 AT-SPI implementation, applications become accessible + when two conditions are met: + \list + \li org.a11y.Status.IsEnabled DBus property is true + \li org.a11y.Status.ScreenReaderEnabled DBus property is true + \endlist + An alternative to setting the DBus AT-SPI properties is to set + the QT_LINUX_ACCESSIBILITY_ALWAYS_ON environment variable. + In addition to QAccessible's static functions, Qt offers one generic interface, QAccessibleInterface, that can be used to wrap all widgets and objects (e.g., QPushButton). This single diff --git a/src/platformsupport/linuxaccessibility/dbusconnection.cpp b/src/platformsupport/linuxaccessibility/dbusconnection.cpp index 18915f8e08..7bdd586a1f 100644 --- a/src/platformsupport/linuxaccessibility/dbusconnection.cpp +++ b/src/platformsupport/linuxaccessibility/dbusconnection.cpp @@ -84,8 +84,14 @@ void DBusConnection::serviceRegistered() QDBusConnection c = QDBusConnection::sessionBus(); OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(A11Y_SERVICE, A11Y_PATH, c, this); + //The variable was introduced because on some embedded platforms there are custom accessibility + //clients which don't set Status.ScreenReaderEnabled to true. The variable is also useful for + //debugging. + static const bool a11yAlwaysOn = !qEnvironmentVariableIsSet("QT_LINUX_ACCESSIBILITY_ALWAYS_ON"); + // a11yStatus->isEnabled() returns always true (since Gnome 3.6) - bool enabled = a11yStatus->screenReaderEnabled(); + bool enabled = a11yAlwaysOn || a11yStatus->screenReaderEnabled(); + if (enabled != m_enabled) { m_enabled = enabled; if (m_a11yConnection.isConnected()) { |