QAccessibleActionInterface 类

QAccessibleActionInterface 类实现对可援引接口动作的支持。 更多...

头: #include <QAccessibleActionInterface>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承者:

QAccessibleWidget

公共函数

virtual ~QAccessibleActionInterface ()
virtual QStringList actionNames () const = 0
virtual void doAction (const QString & actionName ) = 0
virtual QStringList keyBindingsForAction (const QString & actionName ) const = 0
virtual QString localizedActionDescription (const QString & actionName ) const
virtual QString localizedActionName (const QString & actionName ) const

静态公共成员

const QString & decreaseAction ()
const QString & increaseAction ()
QString nextPageAction ()
const QString & pressAction ()
QString previousPageAction ()
QString scrollDownAction ()
QString scrollLeftAction ()
QString scrollRightAction ()
QString scrollUpAction ()
const QString & setFocusAction ()
const QString & showMenuAction ()
const QString & toggleAction ()

详细描述

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 () 和 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 描述
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 correspond 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.

IAccessible2 规范

成员函数文档编制

[virtual noexcept] QAccessibleActionInterface:: ~QAccessibleActionInterface ()

销毁 QAccessibleActionInterface .

[pure virtual] QStringList QAccessibleActionInterface:: actionNames () const

Returns the list of actions supported by this accessible object. The actions returned should be in preferred order, i.e. the action that the user most likely wants to trigger should be returned first, while the least likely action should be returned last.

The list does only contain actions that can be invoked. It won't return disabled actions, or actions associated with disabled UI controls.

The list can be empty.

Note that this list is not localized. For a localized representation re-implement localizedActionName () 和 localizedActionDescription ()

另请参阅 doAction (), localizedActionName (),和 localizedActionDescription ().

[static] const QString &QAccessibleActionInterface:: decreaseAction ()

Returns the name of the decrease default action.

另请参阅 actionNames () 和 localizedActionName ().

[pure virtual] void QAccessibleActionInterface:: doAction (const QString & actionName )

Invokes the action specified by actionName 。注意, actionName is the non-localized name as returned by actionNames () This function is usually implemented by calling the same functions that other user interaction, such as clicking the object, would trigger.

另请参阅 actionNames ().

[static] const QString &QAccessibleActionInterface:: increaseAction ()

Returns the name of the increase default action.

另请参阅 actionNames () 和 localizedActionName ().

[pure virtual] QStringList QAccessibleActionInterface:: keyBindingsForAction (const QString & actionName ) const

Returns a list of the keyboard shortcuts available for invoking the action named actionName .

This is important to let users learn alternative ways of using the application by emphasizing the keyboard.

另请参阅 actionNames ().

[虚拟] QString QAccessibleActionInterface:: localizedActionDescription (const QString & actionName ) const

Returns a localized action description of the action actionName .

When using one of the default names, you can call this function in QAccessibleActionInterface to get the localized string.

另请参阅 actionNames () 和 localizedActionName ().

[虚拟] QString QAccessibleActionInterface:: localizedActionName (const QString & actionName ) const

Returns a localized action name of actionName .

For custom actions this function has to be re-implemented. When using one of the default names, you can call this function in QAccessibleActionInterface to get the localized string.

另请参阅 actionNames () 和 localizedActionDescription ().

[static] QString QAccessibleActionInterface:: nextPageAction ()

Returns the name of the next page default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] const QString &QAccessibleActionInterface:: pressAction ()

Returns the name of the press default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] QString QAccessibleActionInterface:: previousPageAction ()

Returns the name of the previous page default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] QString QAccessibleActionInterface:: scrollDownAction ()

Returns the name of the scroll down default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] QString QAccessibleActionInterface:: scrollLeftAction ()

Returns the name of the scroll left default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] QString QAccessibleActionInterface:: scrollRightAction ()

Returns the name of the scroll right default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] QString QAccessibleActionInterface:: scrollUpAction ()

Returns the name of the scroll up default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] const QString &QAccessibleActionInterface:: setFocusAction ()

Returns the name of the set focus default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] const QString &QAccessibleActionInterface:: showMenuAction ()

Returns the name of the show menu default action.

另请参阅 actionNames () 和 localizedActionName ().

[static] const QString &QAccessibleActionInterface:: toggleAction ()

Returns the name of the toggle default action.

另请参阅 actionNames () 和 localizedActionName ().