Replace (un)checkAction with toggleAction (2/3)
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Tue, 22 May 2012 07:04:59 +0000 (09:04 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 22 May 2012 12:15:43 +0000 (14:15 +0200)
Needed in order to finalize the replacement of {check,uncheck}Action
with toggleAction.

Change-Id: I7328275aa86cf4e8dc093f86597529b41fefd4a6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
src/plugins/accessible/shared/qqmlaccessible.cpp

index 54d0c06..d4d4059 100644 (file)
@@ -138,9 +138,7 @@ QStringList QQmlAccessible::actionNames() const
         break;
     case QAccessible::RadioButton:
     case QAccessible::CheckBox:
-        actions << QAccessibleActionInterface::checkAction()
-                << QAccessibleActionInterface::uncheckAction()
-                << QAccessibleActionInterface::pressAction();
+        actions << QAccessibleActionInterface::toggleAction();
         break;
     case QAccessible::Slider:
     case QAccessible::SpinBox:
@@ -174,12 +172,8 @@ void QQmlAccessible::doAction(const QString &actionName)
     case QAccessible::CheckBox: {
         QVariant checked = object()->property("checked");
         if (checked.isValid()) {
-            if (actionName == QAccessibleActionInterface::pressAction()) {
+            if (actionName == QAccessibleActionInterface::toggleAction()) {
                 object()->setProperty("checked",  QVariant(!checked.toBool()));
-            } else if (actionName == QAccessibleActionInterface::checkAction()) {
-                object()->setProperty("checked",  QVariant(true));
-            } else if (actionName == QAccessibleActionInterface::uncheckAction()) {
-                object()->setProperty("checked",  QVariant(false));
             }
         }
         break;