Accessible QML Type

  • Import Statement: import QtQuick 2.13

  • Group: Accessible is part of qtquick-visual-utility, accessibility

Detailed Description

This class is part of the Accessibility for Qt Quick Applications.

Items the user interacts with or that give information to the user need to expose their information to the accessibility framework. Then assistive tools can make use of that information to enable users to interact with the application in various ways. This enables Qt Quick applications to be used with screen-readers for example.

The most important properties are name, description and role.

Example implementation of a simple button:

 
Sélectionnez
Rectangle {
    id: myButton
    Text {
        id: label
        text: "next"
    }
    Accessible.role: Accessible.Button
    Accessible.name: label.text
    Accessible.description: "shows the next page"
    Accessible.onPressAction: {
        // do a button click
    }
}

The role is set to Button to indicate the type of control. name is the most important information and bound to the text on the button. The name is a short and consise description of the control and should reflect the visual label. In this case it is not clear what the button does with the name only, so description contains an explanation. There is also a signal handler Accessible.pressAction which can be invoked by assistive tools to trigger the button. This signal handler needs to have the same effect as tapping or clicking the button would have.

See Also

See also Accessibility

Property Documentation

 

checkStateMixed : bool

This property holds whether this item is in the partially checked state.

By default this property is false.

See Also

See also checked, checkable

checkable : bool

This property holds whether this item is checkable (like a check box or some buttons).

By default this property is false.

See Also

See also checked

checked : bool

This property holds whether this item is currently checked.

By default this property is false.

See Also

See also checkable

defaultButton : bool

This property holds whether this item is the default button of a dialog.

By defau