diff options
author | Michael Weghorn <[email protected]> | 2025-05-23 10:59:32 +0200 |
---|---|---|
committer | Volker Hilsheimer <[email protected]> | 2025-05-28 21:44:13 +0200 |
commit | da3422ca150ab52c1c2184cdd467ff105ba1de3c (patch) | |
tree | 3a3b1d2a51bbf06ded6a47f08fa6b8fc8f28107b /src/dbus/doc/snippets | |
parent | ca50d727785544237eb9f2d9d9a1d1d465772f2f (diff) |
Introduce a new Locale value for the QAccessible::Attribute
enum class that can be used to specify the locale
of an accessible object.
Use this to implement support for the
"Locale" property of the AT-SPI Accessible interface. [1]
If no locale has explicitly been specified, report
the default locale in the AT-SPI adaptor, as is
already the case in the implementation of the
"GetLocale" method of the AT-SPI Application
interface.
Being able to explicitly specify a locale is of
particular interest when an application contains
objects whose locale differs from the default
application locale, e.g. documents or paragraphs
written in a different language.
Demo LibreOffice change making use of this
new API: [2]
Sample use case with the above-mentioned LibreOffice
change in place:
1) start LibreOffice Writer, using English UI
and document language
2) type "Hello world" for the first paragraph
3) press Enter to create a new paragraph
4) copy-paste "你好世界" ("Hello world" in Chinese)
into the new paragraph
5) start Accerciser
6) select the first paragraph in Accerciser's treeview
of the LibreOffice a11y hierarchy
7) query locale in Accerciser's IPython console
In [1]: acc.get_object_locale()
Out[1]: 'en_GB'
8) select the second paragraph in Accerciser's treeview
of the LibreOffice a11y hierarchy
9) query locale in Accerciser's IPython console
In [2]: acc.get_object_locale()
Out[2]: 'zh_CN'
For UIA on Windows, UIA_CulturePropertyId [3] seems
to be the equivalent property that the new attribute
could be mapped to (to be done separately, not implemented
in this commit).
[1] https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/2e65b0877d67667b06e0dc6ad918a6fd4943c371/xml/Accessible.xml#L55-67
[2] https://gerrit.libreoffice.org/c/core/+/185709
[3] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
[ChangeLog][QtGui][QAccessible::Attribute] Added new
Locale enum value that can be used to specify the
locale of an accessible object.
Fixes: QTBUG-137144
Change-Id: Ice11b9e45b512305dbb8195961b8b08e1389c69e
Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'src/dbus/doc/snippets')
0 files changed, 0 insertions, 0 deletions