Always instantiate QPlatformAccessibility

Instead of returning 0, instantiate QPlatformAccessibility which
delegates the handling of accessibilty to accessibilitybridge plugins.

This makes it possible to implement entirely custom handling of the
accessibility events, making it possible to write for example in-process
screen readers.

Change-Id: I7bcfd83b769af8ca2689fb38add1345719cf804f
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
bb10
Frederik Gladhorn 2016-03-16 17:51:15 +01:00 committed by Frederik Gladhorn
parent d90c234bac
commit b1dc0841fe
1 changed files with 7 additions and 2 deletions

View File

@ -354,11 +354,16 @@ QPlatformInputContext *QPlatformIntegration::inputContext() const
/*!
Returns the platforms accessibility.
The default implementation returns 0, implying no accessibility support.
The default implementation returns QPlatformAccessibility which
delegates handling of accessibility to accessiblebridge plugins.
*/
QPlatformAccessibility *QPlatformIntegration::accessibility() const
{
return 0;
static QPlatformAccessibility *accessibility = 0;
if (Q_UNLIKELY(!accessibility)) {
accessibility = new QPlatformAccessibility;
}
return accessibility;
}
#endif