From 2494c271d49f30e783cba20dd430b64bb9261702 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 3 Dec 2015 08:29:20 +0100 Subject: Fixed qmlqtsensors example There were API changes, that broke the current version. Both the tilt sensor's value and the ambient light sensor's enum value are now part of the reading's instead of the sensor's API. Change-Id: I774ecbcacdcce537358fdb0f3a6794a89572742d Reviewed-by: Alex Blasche --- examples/sensors/qmlqtsensors/qmlqtsensors.qml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qml b/examples/sensors/qmlqtsensors/qmlqtsensors.qml index bc456be5..40492c71 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] } } -- cgit v1.2.3