QAccessibleActionInterface Class
The QAccessibleActionInterface class implements support for invocable actions in the interface. More...
| Header: | #include <QAccessibleActionInterface> |
| qmake: | QT += gui |
| Inherited By: |
Detailed Description
Accessible objects should implement the action interface if they support user interaction. Usually this interface is implemented by classes that also implement QAccessibleInterface.
The supported actions should use the predefined actions offered in this class unless they do not fit a predefined action. In that case a custom action can be added.
When subclassing QAccessibleActionInterface you need to provide a list of actionNames which is the primary means to discover the available actions. Action names are never localized. In order to present actions to the user there are two functions that need to return localized versions of the name and give a description of the action. For the predefined action names use QAccessibleActionInterface::localizedActionName() and QAccessibleActionInterface::localizedActionDescription() to return their localized counterparts.
In general you should use one of the predefined action names, unless describing an action that does not fit these:
| Action name | Description |
|---|---|
| toggleAction() | toggles the item (checkbox, radio button, switch, ...) |
| decreaseAction() | decrease the value of the accessible (e.g. spinbox) |
| increaseAction() | increase the value of the accessible (e.g. spinbox) |
| pressAction() | press or click or activate the accessible (should correspont to clicking the object with the mouse) |
| setFocusAction() | set the focus to this accessible |
| showMenuAction() | show a context menu, corresponds to right-clicks |
In order to invoke the action, doAction() is called with an action name.
Most widgets will simply implement pressAction(). This is what happens when the widget is activated by being clicked, space pressed or similar.