summaryrefslogtreecommitdiffstats
path: root/examples/sensors
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2012-10-19 15:35:41 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-19 20:26:42 +0200
commitb550c4980cf874ce84419a86c933c32504b9b19d (patch)
treecd7587224213787314d17689e1f2a2c18640dd84 /examples/sensors
parent4a49d796a4ef2fb994159afe18153ff65f60194a (diff)
indentation, whitespace and one missing closing brace
Change-Id: I8ae1ffbf38ec6c81c12f8ff487e159206cf00f0d Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'examples/sensors')
-rw-r--r--examples/sensors/qmlqtsensors/qmlqtsensors.qml319
1 files changed, 160 insertions, 159 deletions
diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qml b/examples/sensors/qmlqtsensors/qmlqtsensors.qml
index dfa9c4ec..496aea1f 100644
--- a/examples/sensors/qmlqtsensors/qmlqtsensors.qml
+++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qml
@@ -151,194 +151,195 @@ ApplicationWindow {
}
//! [1]
- Rectangle{
- Button{
- id: calibrate
- anchors.left: mainWnd.left
- anchors.leftMargin: 5
- anchors.top: speedRect.bottom
- height: 30
- width: 80
- text: "Calibrate"
-
- onClicked:{
- tilt.calibrate();
+ Rectangle {
+ Button {
+ id: calibrate
+ anchors.left: mainWnd.left
+ anchors.leftMargin: 5
+ anchors.top: speedRect.bottom
+ height: 30
+ width: 80
+ text: "Calibrate"
+
+ onClicked:{
+ tilt.calibrate();
+ }
}
- }
- Button{
- id: tiltStart
- anchors.top: calibrate.bottom
- anchors.left: mainWnd.left
- anchors.leftMargin: 5
- height: 30
- width: 80
- text: tilt.active ? "Stop" : "Start"
+ Button {
+ id: tiltStart
+ anchors.top: calibrate.bottom
+ anchors.left: mainWnd.left
+ anchors.leftMargin: 5
+ height: 30
+ width: 80
+ text: tilt.active ? "Stop" : "Start"
- onClicked:{
+ onClicked:{
//! [2]
- tilt.active = (tiltStart.text === "Start");
+ tilt.active = (tiltStart.text === "Start");
//! [2]
+ }
}
- }
- Text {
- id: xrottext
- anchors.right: mainWnd.right
- anchors.rightMargin: 5
- anchors.left: useRadian.right
- anchors.leftMargin: 15
- anchors.top: useRadian.top
- anchors.bottom: useRadian.bottom
- verticalAlignment: Text.AlignVCenter
+ Text {
+ id: xrottext
+ anchors.right: mainWnd.right
+ anchors.rightMargin: 5
+ anchors.left: useRadian.right
+ anchors.leftMargin: 15
+ anchors.top: useRadian.top
+ anchors.bottom: useRadian.bottom
+ verticalAlignment: Text.AlignVCenter
//! [3]
- text: "X Rotation: " + tilt.xRotation + "°"
+ text: "X Rotation: " + tilt.xRotation + "°"
//! [3]
- }
+ }
- Text {
- id: yrottext
- anchors.right: mainWnd.right
- anchors.rightMargin: 5
- anchors.left: tiltStart.right
- anchors.leftMargin: 15
- anchors.top: tiltStart.top
- anchors.bottom: tiltStart.bottom
- verticalAlignment: Text.AlignVCenter
+ Text {
+ id: yrottext
+ anchors.right: mainWnd.right
+ anchors.rightMargin: 5
+ anchors.left: tiltStart.right
+ anchors.leftMargin: 15
+ anchors.top: tiltStart.top
+ anchors.bottom: tiltStart.bottom
+ verticalAlignment: Text.AlignVCenter
//! [4]
- text: "Y Rotation: " + tilt.yRotation + "°"
+ text: "Y Rotation: " + tilt.yRotation + "°"
//! [4]
- }
-
- //Ambient Light region
+ }
- Rectangle {
- id: ambientlightLine
- anchors.top: tiltStart.bottom
- anchors.topMargin: 5
- anchors.left: mainWnd.left
- anchors.leftMargin: 5
- anchors.right: mainWnd.right
- anchors.rightMargin: 5
- border.width: 1
- height: 1
- border.color: "#888888"
- }
+ //Ambient Light region
+
+ Rectangle {
+ id: ambientlightLine
+ anchors.top: tiltStart.bottom
+ anchors.topMargin: 5
+ anchors.left: mainWnd.left
+ anchors.leftMargin: 5
+ anchors.right: mainWnd.right
+ anchors.rightMargin: 5
+ border.width: 1
+ height: 1
+ border.color: "#888888"
+ }
- Text {
- id: labelAmbientLight
- anchors.top: ambientlightLine.bottom
- anchors.topMargin: 5
- anchors.left: mainWnd.left
- anchors.right: mainWnd.right
+ Text {
+ id: labelAmbientLight
+ anchors.top: ambientlightLine.bottom
+ anchors.topMargin: 5
+ anchors.left: mainWnd.left
+ anchors.right: mainWnd.right
- horizontalAlignment: Text.AlignHCenter
- font.bold: true
- text: "AmbientLightSensor"
- }
+ horizontalAlignment: Text.AlignHCenter
+ font.bold: true
+ text: "AmbientLightSensor"
+ }
- AmbientLightSensor {
- id: ambientlight
- active: false
+ AmbientLightSensor {
+ id: ambientlight
+ active: false
//! [5]
- onReadingChanged:{
- if (reading.lightLevel == AmbientLightSensor.Unknown)
- ambientlighttext.text = "Ambient light: Unknown";
- else if (reading.lightLevel == AmbientLightSensor.Dark)
- ambientlighttext.text = "Ambient light: Dark";
- else if (reading.lightLevel == AmbientLightSensor.Twilight)
- ambientlighttext.text = "Ambient light: Twilight";
- else if (reading.lightLevel == AmbientLightSensor.Light)
- ambientlighttext.text = "Ambient light: Light";
- else if (reading.lightLevel == AmbientLightSensor.Bright)
- ambientlighttext.text = "Ambient light: Bright";
- else if (reading.lightLevel == AmbientLightSensor.Sunny)
- ambientlighttext.text = "Ambient light: Sunny";
- }
+ onReadingChanged: {
+ if (reading.lightLevel == AmbientLightSensor.Unknown)
+ ambientlighttext.text = "Ambient light: Unknown";
+ else if (reading.lightLevel == AmbientLightSensor.Dark)
+ ambientlighttext.text = "Ambient light: Dark";
+ else if (reading.lightLevel == AmbientLightSensor.Twilight)
+ ambientlighttext.text = "Ambient light: Twilight";
+ else if (reading.lightLevel == AmbientLightSensor.Light)
+ ambientlighttext.text = "Ambient light: Light";
+ else if (reading.lightLevel == AmbientLightSensor.Bright)
+ ambientlighttext.text = "Ambient light: Bright";
+ else if (reading.lightLevel == AmbientLightSensor.Sunny)
+ ambientlighttext.text = "Ambient light: Sunny";
+ }
//! [5]
- }
-
- Button{
- id: ambientlightStart
- anchors.top: labelAmbientLight.bottom
- anchors.topMargin: 5
- anchors.left: mainWnd.left
- anchors.leftMargin: 5
- height: 30
- width: 80
- text: ambientlight.active ? "Stop" : "Start"
-
- onClicked:{
- ambientlight.active = (ambientlightStart.text === "Start" ? true: false);
}
- }
-
- Text {
- id: ambientlighttext
- anchors.left: ambientlightStart.right
- anchors.leftMargin: 15
- anchors.top: ambientlightStart.top
- anchors.bottom: ambientlightStart.bottom
- verticalAlignment: Text.AlignVCenter
- text: "Ambient light: -"
- }
- //Proximity region
+ Button{
+ id: ambientlightStart
+ anchors.top: labelAmbientLight.bottom
+ anchors.topMargin: 5
+ anchors.left: mainWnd.left
+ anchors.leftMargin: 5
+ height: 30
+ width: 80
+ text: ambientlight.active ? "Stop" : "Start"
+
+ onClicked: {
+ ambientlight.active = (ambientlightStart.text === "Start" ? true: false);
+ }
+ }
- Rectangle {
- id: proximityLine
- anchors.top: ambientlightStart.bottom
- anchors.topMargin: 5
- anchors.left: mainWnd.left
- anchors.leftMargin: 5
- anchors.right: mainWnd.right
- anchors.rightMargin: 5
- border.width: 1
- height: 1
- border.color: "#888888"
- }
+ Text {
+ id: ambientlighttext
+ anchors.left: ambientlightStart.right
+ anchors.leftMargin: 15
+ anchors.top: ambientlightStart.top
+ anchors.bottom: ambientlightStart.bottom
+ verticalAlignment: Text.AlignVCenter
+ text: "Ambient light: -"
+ }
- Text {
- id: labelProximityLight
- anchors.top: proximityLine.bottom
- anchors.topMargin: 5
- anchors.left: mainWnd.left
- anchors.right: mainWnd.right
- horizontalAlignment: Text.AlignHCenter
- font.bold: true
- text: "ProximitySensor"
- }
+ //Proximity region
+
+ Rectangle {
+ id: proximityLine
+ anchors.top: ambientlightStart.bottom
+ anchors.topMargin: 5
+ anchors.left: mainWnd.left
+ anchors.leftMargin: 5
+ anchors.right: mainWnd.right
+ anchors.rightMargin: 5
+ border.width: 1
+ height: 1
+ border.color: "#888888"
+ }
- ProximitySensor {
- id: proxi
- active: false
- }
+ Text {
+ id: labelProximityLight
+ anchors.top: proximityLine.bottom
+ anchors.topMargin: 5
+ anchors.left: mainWnd.left
+ anchors.right: mainWnd.right
+ horizontalAlignment: Text.AlignHCenter
+ font.bold: true
+ text: "ProximitySensor"
+ }
- Button{
- id: proxiStart
- anchors.top: labelProximityLight.bottom
- anchors.topMargin: 5
- anchors.left: mainWnd.left
- anchors.leftMargin: 5
- height: 30
- width: 80
- text: proxi.active ? "Stop" : "Start"
+ ProximitySensor {
+ id: proxi
+ active: false
+ }
- onClicked:{
- proxi.active = (proxiStart.text === "Start" ? true: false);
+ Button{
+ id: proxiStart
+ anchors.top: labelProximityLight.bottom
+ anchors.topMargin: 5
+ anchors.left: mainWnd.left
+ anchors.leftMargin: 5
+ height: 30
+ width: 80
+ text: proxi.active ? "Stop" : "Start"
+
+ onClicked: {
+ proxi.active = (proxiStart.text === "Start" ? true: false);
+ }
}
- }
- Text {
- id: proxitext
- anchors.left: proxiStart.right
- anchors.leftMargin: 15
- anchors.top: proxiStart.top
- anchors.bottom: proxiStart.bottom
- verticalAlignment: Text.AlignVCenter
+ Text {
+ id: proxitext
+ anchors.left: proxiStart.right
+ anchors.leftMargin: 15
+ anchors.top: proxiStart.top
+ anchors.bottom: proxiStart.bottom
+ verticalAlignment: Text.AlignVCenter
//! [6]
- text: "Proximity: " + (proxi.reading.near ? "near" : "far")
+ text: "Proximity: " + (proxi.reading.near ? "near" : "far")
//! [6]
+ }
}
}
}