summaryrefslogtreecommitdiffstats
path: root/examples/sensors/qmlsensorgestures/GesturesView.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/GesturesView.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/GesturesView.qml')
-rw-r--r--examples/sensors/qmlsensorgestures/GesturesView.qml54
1 files changed, 27 insertions, 27 deletions
diff --git a/examples/sensors/qmlsensorgestures/GesturesView.qml b/examples/sensors/qmlsensorgestures/GesturesView.qml
index ceab8d10..46e8fead 100644
--- a/examples/sensors/qmlsensorgestures/GesturesView.qml
+++ b/examples/sensors/qmlsensorgestures/GesturesView.qml
@@ -70,86 +70,86 @@ import QtSensors 5.0
*/
Rectangle {
- id: gesturerect
+ id: gestureRect
border.width: 1
anchors.margins: 5
- property alias enabled: sensorGuesture.enabled
+ property alias enabled: sensorGesture.enabled
property int count: 0
property int count1: 0
SensorGesture {
- id: sensorGuesture
+ id: sensorGesture
enabled: true
gestures: availableGestures
onDetected:{
if (gesture === "QtSensors.shake")
- gesturerect.count++;
+ gestureRect.count++;
else
- gesturerect.count1++;
+ gestureRect.count1++;
}
onEnabledChanged: {
- gesturerect.count = 0;
- gesturerect.count1 = 0;
+ gestureRect.count = 0;
+ gestureRect.count1 = 0;
}
}
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
- text: "templates gestures"
+ text: "Gesture Counter"
}
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: "shake : SecondCounter"
+ text: "Shake : SecondCounter"
}
Text {
id: valueText
anchors.top: detectionText.bottom
- anchors.left: gesturerect.left
- width: gesturerect.width / 2
+ anchors.left: gestureRect.left
+ width: gestureRect.width / 2
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 15
- text: gesturerect.count
- visible: sensorGuesture.enabled
+ text: gestureRect.count
+ visible: sensorGesture.enabled
}
Text {
id: valueText1
anchors.top: detectionText.bottom
- anchors.right: gesturerect.right
- width: gesturerect.width / 2
+ anchors.right: gestureRect.right
+ width: gestureRect.width / 2
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 15
- text: gesturerect.count1
- visible: sensorGuesture.enabled
+ text: gestureRect.count1
+ 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: (sensorGuesture.enabled ? "Stop" : "Start")
+ buttonText: (sensorGesture.enabled ? "Stop" : "Start")
enabled: true;
onClicked: {
if (gestureStartStopButton.buttonText === "Start") {
- sensorGuesture.enabled = true;
+ sensorGesture.enabled = true;
}
else {
- sensorGuesture.enabled = false;
+ sensorGesture.enabled = false;
}
}
}