summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/qaccessible.cpp
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2023-02-06 13:16:45 +0100
committerJan Arve Sæther <jan-arve.saether@qt.io>2023-02-28 17:53:10 +0100
commitafbfe30093d49eff0ec4c28c220d33c233b9f807 (patch)
treeaa2ff34af30b311646f7fea822c5891cf3796b2d /src/gui/accessible/qaccessible.cpp
parent50057fec93a3acbd44080bc0c0f41d3dc1f41743 (diff)
a11y: Test and document relations better
The documentation for the RelationFlag enum was not very clear on what was the "first" and "second" object. And the fact that the AT-SPI backend (which these enum values originates from) inverses "first" and "second" makes it harder to understand what how it all fits together. So when (with this change) Qt documents 'QAccessible::Labelled' as "The returned object is labelled by the origin object" AT-SPI documents ATSPI_RELATION_LABELLED_BY as: "The origin object is labelled by the returned object" (Documentation for AT-SPI is rewritten so that it shares the same terminology) Notice that the two objects are exchanged, which means that even if they use the same 'Labelled' relation, the semantic gets 'inversed'. This is already the case today, so we cannot change it. Therefore, to be clear, the relation mapping will remain to be like this: Qt Relation | Maps to AT-SPI | Qt explanation ----------------+-------------------------------+-------------------------------------------------------------------------------- Label | ATSPI_RELATION_LABELLED_BY | The returned object is a Label for the origin object Labelled | ATSPI_RELATION_LABEL_FOR | The returned object is Labelled by the origin object Controller | ATSPI_RELATION_CONTROLLED_BY | The returned object is the Controller for the origin object Controlled | ATSPI_RELATION_CONTROLLER_FOR | The returned object is Controlled by the origin object This mapping can already be seen in qAccessibleRelationToAtSpiRelation() For the record, these future relations should then be mapped to like this: Qt Relation | Maps to AT-SPI | Qt explanation ----------------+-------------------------------+-------------------------------------------------------------------------------- Described | ATSPI_RELATION_DESCRIPTION_FOR| The returned object is described by the origin object DescriptionFor | ATSPI_RELATION_DESCRIBED_BY | The returned object provides a description for the origin object FlowsTo | ATSPI_RELATION_FLOWS_FROM | The returned object has content which flows logically to the origin object FlowsFrom | ATSPI_RELATION_FLOWS_TO | The returned object has content which flows logically from the origin object Change-Id: Ib245ec95564e4886dc6dbbb68abec2b23cd0e534 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'src/gui/accessible/qaccessible.cpp')
-rw-r--r--src/gui/accessible/qaccessible.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 13333bf0b3..a1ed334d54 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -354,12 +354,23 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\enum QAccessible::RelationFlag
This enum type defines bit flags that can be combined to indicate
- the relationship between two accessible objects.
-
- \value Label The first object is the label of the second object.
- \value Labelled The first object is labelled by the second object.
- \value Controller The first object controls the second object.
- \value Controlled The first object is controlled by the second object.
+ the relationship between two accessible objects. It is used by
+ the relations() function, which returns a list of all the related
+ interfaces of the calling object, together with the relations
+ for each object.
+
+ Each entry in the list is a QPair where the \c second member stores
+ the relation type(s) between the \c returned object represented by the
+ \c first member and the \c origin (the caller) interface/object.
+
+ In the table below, the \c returned object refers to the object in
+ the returned list, and the \c origin object is the one represented
+ by the calling interface.
+
+ \value Label The \c returned object is the label for the \c origin object.
+ \value Labelled The \c returned object is labelled by the \c origin object.
+ \value Controller The \c returned object controls the \c origin object.
+ \value Controlled The \c returned object is controlled by the \c origin object.
\value AllRelations Used as a mask to specify that we are interesting in information
about all relations