diff options
author | Johanna Aijala <johanna.aijala@digia.com> | 2013-02-21 09:17:06 +0200 |
---|---|---|
committer | Johanna Aijala <johanna.aijala@digia.com> | 2013-02-21 09:21:34 +0200 |
commit | d9e4b5c1820e62700756ede2ef5290baccc3c1b2 (patch) | |
tree | cc6975c1bd3ea86e4b7e5373560603e5165b7ff4 /examples/quick/accessibility | |
parent | f4d4689d3c09cb4eae30be892be426d4fa185ed4 (diff) | |
parent | fb7ab18fa799032f37fd6f78ab34b76aff91ed6c (diff) |
Merge branch 'stable' into release
Change-Id: I13e80072db1e2c14a37b6a123276be81b085e87e
Diffstat (limited to 'examples/quick/accessibility')
-rw-r--r-- | examples/quick/accessibility/accessibility.qml | 29 | ||||
-rw-r--r-- | examples/quick/accessibility/content/Button.qml | 6 | ||||
-rw-r--r-- | examples/quick/accessibility/content/Checkbox.qml | 9 | ||||
-rw-r--r-- | examples/quick/accessibility/content/Slider.qml | 13 | ||||
-rw-r--r-- | examples/quick/accessibility/doc/src/accessibility.qdoc | 2 | ||||
-rw-r--r-- | examples/quick/accessibility/main.cpp | 2 |
6 files changed, 35 insertions, 26 deletions
diff --git a/examples/quick/accessibility/accessibility.qml b/examples/quick/accessibility/accessibility.qml index fe9e03dbc4..6fb25e37d7 100644 --- a/examples/quick/accessibility/accessibility.qml +++ b/examples/quick/accessibility/accessibility.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQml module of the Qt Toolkit. @@ -42,7 +42,6 @@ import QtQuick 2.0 import "content" - Rectangle { id: window @@ -56,11 +55,9 @@ Rectangle { anchors.margins: 10 width: parent.width - Row { spacing: 6 width: column.width - height: column.h Text { id: subjectLabel @@ -71,6 +68,7 @@ Rectangle { text: "Subject:" y: 3 } + Rectangle { id: subjectBorder Accessible.role: Accessible.EditableText @@ -88,19 +86,18 @@ Rectangle { text: "Vacation plans" KeyNavigation.tab: textEdit } - } - } + Rectangle { id: textBorder Accessible.role: Accessible.EditableText - property alias text : textEdit.text + property alias text: textEdit.text border.width: 1 border.color: "black" width: parent.width - 2 - height: 200 + TextEdit { id: textEdit y: 3 @@ -113,6 +110,7 @@ Rectangle { KeyNavigation.priority: KeyNavigation.BeforeItem } } + Text { id : status width: column.width @@ -120,23 +118,30 @@ Rectangle { Row { spacing: 6 - Button { id: sendButton; width: 100; height: column.h + 20; text: "Send"; - onClicked : { status.text = "Send" } + Button { + id: sendButton + width: 100; height: 20 + text: "Send" + onClicked: { status.text = "Send" } KeyNavigation.tab: discardButton } - Button { id: discardButton; width: 100; height: column.h + 20; text: "Discard"; - onClicked : { status.text = "Discard" } + Button { id: discardButton + width: 100; height: 20 + text: "Discard" + onClicked: { status.text = "Discard" } KeyNavigation.tab: checkBox } } Row { spacing: 6 + Checkbox { id: checkBox checked: false KeyNavigation.tab: slider } + Slider { id: slider value: 10 diff --git a/examples/quick/accessibility/content/Button.qml b/examples/quick/accessibility/content/Button.qml index fa26177d32..4034f074a9 100644 --- a/examples/quick/accessibility/content/Button.qml +++ b/examples/quick/accessibility/content/Button.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQml module of the Qt Toolkit. @@ -64,8 +64,7 @@ Rectangle { GradientStop { position: 1.0; color: button.focus ? "red" : "blue" } } - // border.width: 1 - //border.color: "black"; + radius: 5 antialiasing: true @@ -84,5 +83,6 @@ Rectangle { anchors.fill: parent onClicked: parent.clicked() } + Keys.onSpacePressed: clicked() } diff --git a/examples/quick/accessibility/content/Checkbox.qml b/examples/quick/accessibility/content/Checkbox.qml index f16f66ebb2..7c20f55e90 100644 --- a/examples/quick/accessibility/content/Checkbox.qml +++ b/examples/quick/accessibility/content/Checkbox.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtDeclarative module of the Qt Toolkit. @@ -39,10 +39,8 @@ ** ****************************************************************************/ - import QtQuick 2.0 - FocusScope { id: checkbox @@ -56,24 +54,29 @@ FocusScope { Row { spacing: 2 + Rectangle { width: 12 height: 12 border.width: checkbox.focus ? 2 : 1 border.color: "black" + Text { id: checkboxText text: checkbox.checked ? "x" : "" anchors.centerIn: parent } } + Text { text: checkbox.text } } + MouseArea { anchors.fill: parent onClicked: checkbox.checked = !checkbox.checked } + Keys.onSpacePressed: checkbox.checked = !checkbox.checked } diff --git a/examples/quick/accessibility/content/Slider.qml b/examples/quick/accessibility/content/Slider.qml index a116308a14..c6eaca30a2 100644 --- a/examples/quick/accessibility/content/Slider.qml +++ b/examples/quick/accessibility/content/Slider.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtDeclarative module of the Qt Toolkit. @@ -39,7 +39,6 @@ ** ****************************************************************************/ - import QtQuick 2.0 // Minimal slider implementation @@ -49,10 +48,10 @@ Rectangle { property alias text: buttonText.text Accessible.role: Accessible.Slider - property int value : 5 // required - property int minimumValue : 0 // optional (default INT_MIN) - property int maximumValue : 20 // optional (default INT_MAX) - property int stepSize : 1 // optional (default 1) + property int value: 5 // required + property int minimumValue: 0 // optional (default INT_MIN) + property int maximumValue: 20 // optional (default INT_MAX) + property int stepSize: 1 // optional (default 1) width: 100 height: 30 @@ -77,6 +76,7 @@ Rectangle { anchors.centerIn: parent font.pixelSize: parent.height * .5 } + MouseArea { anchors.fill: parent onClicked: { @@ -84,6 +84,7 @@ Rectangle { slider.value = pos } } + Keys.onLeftPressed: value > minimumValue ? value = value - stepSize : minimumValue Keys.onRightPressed: value < maximumValue ? value = value + stepSize : maximumValue } diff --git a/examples/quick/accessibility/doc/src/accessibility.qdoc b/examples/quick/accessibility/doc/src/accessibility.qdoc index cb3ba4ae14..9054b5e394 100644 --- a/examples/quick/accessibility/doc/src/accessibility.qdoc +++ b/examples/quick/accessibility/doc/src/accessibility.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. diff --git a/examples/quick/accessibility/main.cpp b/examples/quick/accessibility/main.cpp index 07b2e719aa..aee428a1ab 100644 --- a/examples/quick/accessibility/main.cpp +++ b/examples/quick/accessibility/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. |