summaryrefslogtreecommitdiffstats
path: root/examples/sensors/qmlsensorgestures/GestureView.qml
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-10-09 13:26:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-04 11:46:55 +0100
commit76d4cae393305a1a87e53b88ef80a2a1a87758b7 (patch)
tree161fac4d236e2434873754322562497ebdb6229f /examples/sensors/qmlsensorgestures/GestureView.qml
parentb8b341cb805502bd0cc4a61d67aebe9984f59eb4 (diff)
Doc: Clean up SensorGesture QML example
Fix warnings, fix property names and strings shown in the UI. Also touch the documentation and correct a typo in the qdoc file name. Task-number: QTBUG-33877 Change-Id: Ie790708ac4d1f8d72af03b52ee361d0bf3994adc Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'examples/sensors/qmlsensorgestures/GestureView.qml')
-rw-r--r--examples/sensors/qmlsensorgestures/GestureView.qml35
1 files changed, 17 insertions, 18 deletions
diff --git a/examples/sensors/qmlsensorgestures/GestureView.qml b/examples/sensors/qmlsensorgestures/GestureView.qml
index c12c6f28..8449f18a 100644
--- a/examples/sensors/qmlsensorgestures/GestureView.qml
+++ b/examples/sensors/qmlsensorgestures/GestureView.qml
@@ -73,26 +73,26 @@ import QtSensors 5.0
*/
Rectangle {
- id: gesturerect
+ id: gestureRect
border.width: 1
anchors.margins: 5
//! [2]
- property alias gestureid: sensorGesture.gestures
+ property alias gestureId: sensorGesture.gestures
//! [2]
- property alias gesturetitle: titleText.text
+ property alias gestureTitle: titleText.text
property alias enabled: sensorGesture.enabled
- property string oldgesture: ""
+ property string oldGesture: ""
property int count: 0
//! [1]
SensorGesture {
id: sensorGesture
enabled: false
- onDetected:{
- if (gesture !== oldgesture)
+ onDetected: {
+ if (gesture !== oldGesture)
count = 0;
valueText.text = gesture + " " + count;
- oldgesture = gesture;
+ oldGesture = gesture;
count++;
}
onEnabledChanged: {
@@ -103,9 +103,9 @@ Rectangle {
Text {
id: titleText
- anchors.top: gesturerect.top
- anchors.left: gesturerect.left
- anchors.right: gesturerect.right
+ anchors.top: gestureRect.top
+ anchors.left: gestureRect.left
+ anchors.right: gestureRect.right
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 20
font.bold: true
@@ -115,28 +115,27 @@ Rectangle {
Text {
id: detectionText
anchors.top: titleText.bottom
- anchors.left: gesturerect.left
- anchors.right: gesturerect.right
+ anchors.left: gestureRect.left
+ anchors.right: gestureRect.right
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 15
- text: "detection:"
+ text: "Detection:"
}
Text {
id: valueText
anchors.top: detectionText.bottom
- anchors.left: gesturerect.left
- anchors.right: gesturerect.right
+ anchors.left: gestureRect.left
+ anchors.right: gestureRect.right
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 15
- text: ("")
visible: sensorGesture.enabled
}
Button{
id: gestureStartStopButton
- anchors.left: gesturerect.left
- anchors.bottom: gesturerect.bottom
+ anchors.left: gestureRect.left
+ anchors.bottom: gestureRect.bottom
height: 30
width: 100
buttonText: (sensorGesture.enabled ? "Stop" : "Start")