diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-08 23:43:34 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-08 23:43:34 +0200 |
commit | 90f43c450db8cad9f10d86c006f251dad91a4492 (patch) | |
tree | 2f4f02df3d6a121645714e73c762308772ab46bc /examples/sensors/qmlqtsensors/qmlqtsensors.qml | |
parent | 6e7d77219a583e9a9d8ff14f32f9400543cd2add (diff) | |
parent | 33d15b76dfdb95da5970b8e0294bbb87ea1eb9a8 (diff) | |
download | qtsensors-90f43c450db8cad9f10d86c006f251dad91a4492.tar.gz |
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I43577461af4808e48de9b229843f324f195ae3d0
Diffstat (limited to 'examples/sensors/qmlqtsensors/qmlqtsensors.qml')
-rw-r--r-- | examples/sensors/qmlqtsensors/qmlqtsensors.qml | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qml b/examples/sensors/qmlqtsensors/qmlqtsensors.qml index bc456be..40492c7 100644 --- a/examples/sensors/qmlqtsensors/qmlqtsensors.qml +++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qml @@ -106,18 +106,18 @@ ApplicationWindow { active: false //! [5] onReadingChanged: { - if (reading.lightLevel == AmbientLightSensor.Unknown) - ambientlighttext.text = "Ambient light: Unknown"; - else if (reading.lightLevel == AmbientLightSensor.Dark) + if (reading.lightLevel == AmbientLightReading.Dark) ambientlighttext.text = "Ambient light: Dark"; - else if (reading.lightLevel == AmbientLightSensor.Twilight) + else if (reading.lightLevel == AmbientLightReading.Twilight) ambientlighttext.text = "Ambient light: Twilight"; - else if (reading.lightLevel == AmbientLightSensor.Light) + else if (reading.lightLevel == AmbientLightReading.Light) ambientlighttext.text = "Ambient light: Light"; - else if (reading.lightLevel == AmbientLightSensor.Bright) + else if (reading.lightLevel == AmbientLightReading.Bright) ambientlighttext.text = "Ambient light: Bright"; - else if (reading.lightLevel == AmbientLightSensor.Sunny) + else if (reading.lightLevel == AmbientLightReading.Sunny) ambientlighttext.text = "Ambient light: Sunny"; + else + ambientlighttext.text = "Ambient light: Unknown"; } //! [5] } @@ -160,7 +160,7 @@ ApplicationWindow { height: 30 verticalAlignment: Text.AlignVCenter //! [3] - text: "X Rotation: " + tilt.xRotation + "°" + text: "X Rotation: " + (tilt.reading ? tilt.reading.xRotation.toFixed(2) + "°" : "Unknown") //! [3] } } @@ -184,7 +184,7 @@ ApplicationWindow { height: 30 verticalAlignment: Text.AlignVCenter //! [4] - text: "Y Rotation: " + tilt.yRotation + "°" + text: "Y Rotation: " + (tilt.reading ? tilt.reading.yRotation.toFixed(2) + "°" : "Unknown") //! [4] } } |