summaryrefslogtreecommitdiffstats
path: root/examples/sensors/qmlqtsensors/qmlqtsensors.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-19 16:09:02 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-19 19:27:43 +0100
commit5cf1a2f7f4ac4e71b085ef53ff5a05c4676f7ce2 (patch)
treeeff94d6fba0053177b0f6dac2e93b9ce27cbf294 /examples/sensors/qmlqtsensors/qmlqtsensors.qml
parent5e8d2b4e266916761a26905f0930add305c308cf (diff)
parentfbaca62cd0a7309f04bf82101c8e20dbbf423192 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-alpha1
Conflicts: .qmake.conf src/sensors/doc/src/compatmap.qdoc Change-Id: I4049bc3c335a8a9db5c935032207d0bcfba78480
Diffstat (limited to 'examples/sensors/qmlqtsensors/qmlqtsensors.qml')
-rw-r--r--examples/sensors/qmlqtsensors/qmlqtsensors.qml18
1 files changed, 9 insertions, 9 deletions
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]
}
}