QT_BEGIN_NAMESPACE
/*!
- \qmlclass Accessible QQuickAccessibleAttached
- \brief Attached property to enable accessibility of QML items.
+ \qmltype Accessible
+ \instantiates QQuickAccessibleAttached
+ \brief Enables accessibility of QML items
\inqmlmodule QtQuick 2
- \ingroup qml-basic-interaction-elements
+ \ingroup qtquick-visual-utility
\ingroup accessibility
This class is part of \l {Accessibility for Qt Quick Applications}.
\qml
Item {
id: myButton
+
Text {
id: label
// ...
}
+
Accessible.name: label.text
Accessible.role: Accessible.Button
- funtion accessiblePressAction { ... }
+
+ function accessiblePressAction() {
+ //...
+ }
}
\endqml
\table
\header
- \o \bold {Role}
- \o \bold {Expected property}
- \o
+ \li \b {Role}
+ \li \b {Expected property}
+ \li
\row
- \o Button
- \o function accessiblePressAction
- \o Called when the button receives a press action. The implementation should visually simulate a button click and perform the button action.
+ \li Button
+ \li function accessiblePressAction
+ \li Called when the button receives a press action. The implementation should visually simulate a button click and perform the button action.
\row
- \o CheckBox, Radiobutton
- \o checked
- \o The check state of the check box. Updated on Press, Check and Uncheck actions.
+ \li CheckBox, Radiobutton
+ \li checked
+ \li The check state of the check box. Updated on Press, Check and Uncheck actions.
\row
- \o Slider, SpinBox, Dial, ScrollBar
- \o value, minimumValue, maximumValue, stepSize
- \o value will be updated on increase and decrase actions, in accordance with the other properties
+ \li Slider, SpinBox, Dial, ScrollBar
+ \li value, minimumValue, maximumValue, stepSize
+ \li value will be updated on increase and decrase actions, in accordance with the other properties
\endtable
*/
// Enable accessibility for items with accessible content. This also
// enables accessibility for the ancestors of souch items.
item->d_func()->setAccessibleFlagAndListener();
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectCreated, item));
+ QAccessibleEvent ev(item, QAccessible::ObjectCreated);
+ QAccessible::updateAccessibility(&ev);
}
QQuickAccessibleAttached::~QQuickAccessibleAttached()