Add accessibility notification role

On Linux this role is needed to make desktop notifications work.
There is no equivalent for Windows, iOS or macOS. On these platforms the
role will have no effect.

Fixes: QTBUG-76333
Change-Id: I4ef3b3321f7a0e2c09c1ce432a668428d14c52b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
bb10
Frederik Gladhorn 2019-06-12 10:21:49 +02:00
parent 1975a98345
commit a3e69954f5
3 changed files with 4 additions and 0 deletions

View File

@ -350,6 +350,7 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\value MenuItem An item in a menu or menu bar.
\value NoRole The object has no role. This usually indicates an invalid object.
\value Note A section whose content is parenthetic or ancillary to the main content of the resource.
\value Notification An object that represents a notification (e.g. in the system tray). This role only has an effect on Linux.
\value PageTab A page tab that the user can select to switch to a different page in a dialog.
\value PageTabList A list of page tabs.
\value Paragraph A paragraph of text (usually found in documents).

View File

@ -299,6 +299,7 @@ public:
Paragraph = 0x00000083,
WebDocument = 0x00000084,
Section = 0x00000085,
Notification = 0x00000086,
// IAccessible2 roles
// IA2_ROLE_CANVAS = 0x401, ### Qt 6 use this one instead of Canvas above

View File

@ -265,6 +265,8 @@ static RoleMapping map[] = {
//: Role of an accessible object
{ QAccessible::Desktop, ATSPI_ROLE_DESKTOP_FRAME, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "desktop") },
//: Role of an accessible object
{ QAccessible::Notification, ATSPI_ROLE_NOTIFICATION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "notification") },
//: Role of an accessible object
{ QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "unknown") }
};