Remove redundant QT_NO_ACCESSIBILTY.
[profile/ivi/qtdeclarative.git] / src / quick / items / qquickaccessibleattached.cpp
index b28c28b..c4fc80f 100644 (file)
@@ -3,7 +3,7 @@
 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/
 **
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the QtQml module of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:LGPL$
 ** GNU Lesser General Public License Usage
 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}.
@@ -98,12 +99,18 @@ QT_BEGIN_NAMESPACE
     \qml
     Item {
         id: myButton
+
         Text {
             id: label
             // ...
         }
+
         Accessible.name: label.text
         Accessible.role: Accessible.Button
+
+        function accessiblePressAction() {
+            //...
+        }
     }
     \endqml
 
@@ -112,29 +119,24 @@ QT_BEGIN_NAMESPACE
 
     \table
     \header
-        \o \bold {Role}
-        \o \bold {Expected property}
-        \o
+        \li \b {Role}
+        \li \b {Expected property}
+        \li
 
     \row
-       \o CheckBox
-       \o checked
-       \o The check state of the check box.
-    \row
-       \o RadioButton
-       \o checked
-       \o The selected state of the radio button.
+        \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 Button
-       \o checkable
-       \o Whether the button is checkable.
+       \li CheckBox, Radiobutton
+       \li checked
+       \li The check state of the check box. Updated on Press, Check and Uncheck actions.
     \row
-       \o Button
-       \o checked
-       \o Whether the button is checked (only if checkable is true).
+       \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
-
 */
 
 QQuickAccessibleAttached::QQuickAccessibleAttached(QObject *parent)
@@ -148,7 +150,8 @@ QQuickAccessibleAttached::QQuickAccessibleAttached(QObject *parent)
     // 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, 0));
+    QAccessibleEvent ev(item, QAccessible::ObjectCreated);
+    QAccessible::updateAccessibility(&ev);
 }
 
 QQuickAccessibleAttached::~QQuickAccessibleAttached()