Clean up accessibility QtQuick example
authorTopi Reinio <topi.reinio@digia.com>
Mon, 21 Jan 2013 14:53:47 +0000 (15:53 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 21 Jan 2013 15:19:33 +0000 (16:19 +0100)
Remove an undefined value (column.h) used in the accessibility
example and fix minor indentation and style issues.

Task-number: QTBUG-29225
Change-Id: I118ca7ee4fd24a3e94eb9b39e60514314ddcd7f0
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>

examples/quick/accessibility/accessibility.qml
examples/quick/accessibility/content/Button.qml
examples/quick/accessibility/content/Checkbox.qml
examples/quick/accessibility/content/Slider.qml

index 1d6b4ab..6fb25e3 100644 (file)
@@ -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
index 8afc197..4034f07 100644 (file)
@@ -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()
 }
index c67d593..7c20f55 100644 (file)
 **
 ****************************************************************************/
 
-
 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
 }
index 314c7af..c6eaca3 100644 (file)
@@ -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
 }