From 6f3a14a73e5f74de8f7f365fb2736e065254930f Mon Sep 17 00:00:00 2001 From: Wolfgang Beck Date: Fri, 14 Oct 2011 11:14:01 +1000 Subject: MTMW-347 Replace dataRate with speed in TltSensor Change-Id: Icdca79436d1fe0f0e7f5035ab1e27bc958a9e517 Reviewed-on: http://codereview.qt-project.org/6634 Reviewed-by: Wolfgang Beck --- examples/sensors/qmlqtsensors5/main.qml | 62 +++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 7 deletions(-) (limited to 'examples/sensors') diff --git a/examples/sensors/qmlqtsensors5/main.qml b/examples/sensors/qmlqtsensors5/main.qml index a1144d8c..e93e8825 100644 --- a/examples/sensors/qmlqtsensors5/main.qml +++ b/examples/sensors/qmlqtsensors5/main.qml @@ -43,13 +43,13 @@ import QtQuick 2.0 import QtSensors 5.0 /* Layout - tiltrect - / ------------------------------------------------------------/ + tiltrect + / +----------------------------------------------------------------------------/ | Accuracy <----- textAccuracy -| @ 0 Degree <- selButton0DegreeAccuracy -| O 1 Degree <- selButton1DegreeAccuracy -| O 5 Degree <- selButton5DegreeAccuracy +| @ 0 Degree <- selButton0DegreeAccuracy @ Slow <- selButtonSlowSpeed +| O 1 Degree <- selButton1DegreeAccuracy O Medium <- selButtonMediumSpeed +| O 5 Degree <- selButton5DegreeAccuracy O Fast <- selButtonFastSpeed | ----------- | |calibrate| <------------------ calibrate | ----------- @@ -73,7 +73,7 @@ import QtSensors 5.0 | --------- | |start | <-------------------- proxiStart | --------- ------------------------------------------------------------- +------------------------------------------------------------------------------ */ @@ -95,12 +95,21 @@ Rectangle { enabled: false accuracy: 1.0 } + Text{ id: textAccuracy x: 5 y: 20 text: "Accuracy" } + + Text{ + id: textSpeed + x: 150 + y: 20 + text: "Speed" + } + SelectionButton{ id: selButton0DegreeAccuracy x: 5 @@ -113,6 +122,19 @@ Rectangle { tilt.accuracy = 0.0; } } + SelectionButton{ + id: selButtonSlowSpeed + x: 150 + y: 45 + checked: true + text: "Slow" + onClicked:{ + selButtonMediumSpeed.setCheck(false); + selButtonFastSpeed.setCheck(false); + tilt.speed = TiltSensor.Slow; + } + } + SelectionButton{ id: selButton1DegreeAccuracy x: 5 @@ -125,6 +147,19 @@ Rectangle { tilt.accuracy = (tilt.unit == TiltSensor.Degrees ? 1.0 : (3.14 / 180.0)); } } + SelectionButton{ + id: selButtonMediumSpeed + x: 150 + y: 70 + checked: false + text: "Medium" + onClicked:{ + selButtonSlowSpeed.setCheck(false); + selButtonFastSpeed.setCheck(false); + tilt.speed = TiltSensor.Medium; + } + } + SelectionButton{ id: selButton5DegreeAccuracy x: 5 @@ -138,6 +173,19 @@ Rectangle { } } + SelectionButton{ + id: selButtonFastSpeed + x: 150 + y: 95 + checked: false + text: "Fast" + onClicked:{ + selButtonSlowSpeed.setCheck(false); + selButtonMediumSpeed.setCheck(false); + tilt.speed = TiltSensor.Fast; + } + } + Button{ id: calibrate x: 5 -- cgit v1.2.3