diff options
author | Wolfgang Beck <wolfgang.beck@nokia.com> | 2011-09-28 13:55:12 +1000 |
---|---|---|
committer | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-10-10 09:25:31 +1000 |
commit | c25e4e542fd846facb1ca250d44829c0121abdd2 (patch) | |
tree | d9133e16dd718488d3d8e22216747b0c9cc6430c /examples | |
parent | 4e04cda0e600f4e3bb148956ba631647a5c1fa4c (diff) | |
download | qtsensors-c25e4e542fd846facb1ca250d44829c0121abdd2.tar.gz |
MTMW356 Coderevew changes for the AmbientLightSensor QML Element
Change-Id: Ic5ceb21897fdf65ca611ad5ff4c7ac397b44547c
Reviewed-on: http://codereview.qt-project.org/5664
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Wolfgang Beck <wolfgang.beck@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sensors/qmlqtsensors5/main.qml | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/examples/sensors/qmlqtsensors5/main.qml b/examples/sensors/qmlqtsensors5/main.qml index b0f213c..e1de104 100644 --- a/examples/sensors/qmlqtsensors5/main.qml +++ b/examples/sensors/qmlqtsensors5/main.qml @@ -238,7 +238,7 @@ Rectangle { } Rectangle { - id: ablrect + id: ambientlightrect x: 2 y: tiltrect.y + tiltrect.height + 10 width: 315 @@ -246,45 +246,45 @@ Rectangle { border.width: 1 AmbientLightSensor { - id: abl - running: false + id: ambientlight + enabled: false onLightLevelChanged:{ - if (abl.lightLevel == AmbientLightSensor.Undefined) - abltext.text = "Ambient light: Undefined"; - else if (abl.lightLevel == AmbientLightSensor.Dark) - abltext.text = "Ambient light: Dark"; - else if (abl.lightLevel == AmbientLightSensor.Twilight) - abltext.text = "Ambient light: Twilight"; - else if (abl.lightLevel == AmbientLightSensor.Light) - abltext.text = "Ambient light: Light"; - else if (abl.lightLevel == AmbientLightSensor.Bright) - abltext.text = "Ambient light: Bright"; - else if (abl.lightLevel == AmbientLightSensor.Sunny) - abltext.text = "Ambient light: Sunny"; + if (ambientlight.lightLevel == AmbientLightSensor.Unknown) + ambientlighttext.text = "Ambient light: Unknown"; + else if (ambientlight.lightLevel == AmbientLightSensor.Dark) + ambientlighttext.text = "Ambient light: Dark"; + else if (ambientlight.lightLevel == AmbientLightSensor.Twilight) + ambientlighttext.text = "Ambient light: Twilight"; + else if (ambientlight.lightLevel == AmbientLightSensor.Light) + ambientlighttext.text = "Ambient light: Light"; + else if (ambientlight.lightLevel == AmbientLightSensor.Bright) + ambientlighttext.text = "Ambient light: Bright"; + else if (ambientlight.lightLevel == AmbientLightSensor.Sunny) + ambientlighttext.text = "Ambient light: Sunny"; } } Text { - id: abltext + id: ambientlighttext x: 5 y: 10 text: "Ambient light: -" } Button{ - id: ablStart + id: ambientlightStart x: 5 y: 35 text: "start" checkColor: "lightblue" unCheckColor: "lightyellow" - checked: abl.running + checked: ambientlight.enabled color: "lightyellow" onClicked:{ - abl.running = ablStart.checked; - if (ablStart.checked) - ablStart.text = "running"; + ambientlight.enabled = ambientlightStart.checked; + if (ambientlightStart.checked) + ambientlightStart.text = "running"; else - ablStart.text = "stopped"; + ambientlightStart.text = "stopped"; } } } @@ -292,7 +292,7 @@ Rectangle { Rectangle { id: proxirect x: 2 - y: ablrect.y + ablrect.height + 10 + y: ambientlightrect.y + ambientlightrect.height + 10 width: 315 height: 70 border.width: 1 |