diff options
author | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2012-01-10 12:12:51 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-07 20:08:19 +0100 |
commit | 70966df1be02dd94ecf9a122ff9e4976245aeb92 (patch) | |
tree | 372db90105c34d0c2a72e029f4e087fdc93423b7 /examples/declarative/accessibility/widgets/Checkbox.qml | |
parent | 3f9b58c0890a4263730e2c06b46e7a69d4bfb62d (diff) |
Improve accessibility action support for Qt Quick
Add interface_cast for the action interface.
Implement actions for the following roles:
Button : Press
CheckBox, RadioButton : Press, Check, Uncheck
Slider, Spinbox, Dial, ScrollBar : Increment, Decrement
Change-Id: Ic8e0d17c709ba51655f3f4b699092baf603b6f18
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'examples/declarative/accessibility/widgets/Checkbox.qml')
-rw-r--r-- | examples/declarative/accessibility/widgets/Checkbox.qml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/examples/declarative/accessibility/widgets/Checkbox.qml b/examples/declarative/accessibility/widgets/Checkbox.qml new file mode 100644 index 0000000000..17eb733197 --- /dev/null +++ b/examples/declarative/accessibility/widgets/Checkbox.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** 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. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +import QtQuick 2.0 + + +Rectangle { + id: checkbox + + Accessible.role: Accessible.CheckBox + + property bool checked // required variable + + width: 30 + height: 30 + + + Text { + id: checkboxText + text: parent.checked ? "on" : "off" + anchors.centerIn: parent + } +} |