summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/examples/sensorgestures.qdoc2
-rw-r--r--doc/src/images/sensorgesturecpp.pngbin0 -> 33013 bytes
-rw-r--r--doc/src/imports/qtsensors5.qdoc23
-rw-r--r--doc/src/qmlsensorgtestures.qdoc2
-rw-r--r--doc/src/qtsensorgestures-emulator.qdoc82
-rw-r--r--doc/src/qtsensors-cpp.qdoc6
-rw-r--r--doc/src/qtsensors.qdoc12
-rw-r--r--examples/sensors/sensorgestures/mainwindow.h5
-rw-r--r--examples/sensors/sensors.pro2
-rw-r--r--examples/sensors/shakeit/shakeit.qdoc3
-rw-r--r--src/sensors/qirproximitysensor.cpp8
11 files changed, 120 insertions, 25 deletions
diff --git a/doc/src/examples/sensorgestures.qdoc b/doc/src/examples/sensorgestures.qdoc
index f21ea371..2fb1fe21 100644
--- a/doc/src/examples/sensorgestures.qdoc
+++ b/doc/src/examples/sensorgestures.qdoc
@@ -28,8 +28,10 @@
/*!
\page sensorgestureexample.html
\title C++ Sensor Gestures Example
+ \ingroup qtsensors-examples
\brief The sensor gesture example demonstrates the steps for creating a C++ application
that uses sensor gestures and the included shake sensor.
+ \image sensorgesturecpp.png
QSensorGestures class defines one predefined signal, \c { void detected(const QString &) }
diff --git a/doc/src/images/sensorgesturecpp.png b/doc/src/images/sensorgesturecpp.png
new file mode 100644
index 00000000..4d453cf2
--- /dev/null
+++ b/doc/src/images/sensorgesturecpp.png
Binary files differ
diff --git a/doc/src/imports/qtsensors5.qdoc b/doc/src/imports/qtsensors5.qdoc
index 2eb6aeb0..6f1a46a4 100644
--- a/doc/src/imports/qtsensors5.qdoc
+++ b/doc/src/imports/qtsensors5.qdoc
@@ -33,23 +33,22 @@
\section1 Overview
The identifying string for this component is \e QtSensors.
- Use this in the QML \e import statement.
+ Use this in the QML import statement, as such: \e import QtSensors 5.0
The QML Sensors 5 Plugin provides an easy to use interface to the Sensors API.
- It enables us to receive sensor events and to read current values from
+ It enables the receiving of sensor events and reading current values from the
sensors.
- The plugin contains many sensor types and properties to read values
- from them. As an example consider the tilt sensor. The qmlsensors2
- simply displays text on-screen to show the current tilt.
+ The plugin contains many sensor types and properties to read values.
+ As an example, consider the tilt sensor. The \l {QML QtSensors example}
+ simply displays text on-screen to show the current tilt value.
- The QML code that reads the value is quite simple. Here we see a QML component
- tilt declared which is an \l TiltSensor element. First
- the sensor is started by setting the running property
- to true. The element receives a signal when the x and y rotation changes and it
- can be picked up by the onXRotationChanged and onYRotationChanged slot. Now the
- xRotation and yRotation property of this element can be
- used to extract the current tilt so that it can be used for further calulations.
+ The QML code to read the value is quite simple. Below is a QML \l TiltSensor element
+ declared with an id of \e tilt. The sensor is started by setting the running
+ property to true. The element receives a signal when the x and y rotation
+ changes and it can be picked up by the onXRotationChanged and onYRotationChanged
+ slot. Now the xRotation and yRotation property of this element can be used to
+ extract the current tilt value so that it can be used for further calculations.
\qml
TiltSensor {
diff --git a/doc/src/qmlsensorgtestures.qdoc b/doc/src/qmlsensorgtestures.qdoc
index 7176854a..96b6987b 100644
--- a/doc/src/qmlsensorgtestures.qdoc
+++ b/doc/src/qmlsensorgtestures.qdoc
@@ -57,5 +57,7 @@
\snippet ../examples/sensors/qmlsensorgestures/qml_app/GestureList.qml 4
+\sa {ShakeIt! QML Sensor Gestures Example}
+
*/
diff --git a/doc/src/qtsensorgestures-emulator.qdoc b/doc/src/qtsensorgestures-emulator.qdoc
new file mode 100644
index 00000000..f6692783
--- /dev/null
+++ b/doc/src/qtsensorgestures-emulator.qdoc
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\group sensorgesture_emulator_topics
+\title QtSensorGestures Emulator
+\brief Information about the development of clients and recognizer plugins
+ using QtSensorGestures
+
+\section1 Overview
+
+Whether creating client apps using Qt's built-in sensor gestures, or
+creating customized recognizers, the Emulator can be used to help develop client
+apps and recognizers using the special 'QtSensors.emulator' plugin to send
+arbitrary signals to the emulator environment.
+
+\section1 Developing sensor gesture clients.
+
+For instance, the Emulator can be used for writing a client app that needs
+to use a 'spin' gesture. The app can temporarily connect and start the
+'QtSensors.emulator' plugin in the Emulator.
+
+Under the 'Sensors' heading in the Emulator control, you will see an edit
+box for 'Sensor gestures'.
+
+Type the word, "spin", hit enter to set it, and then click the 'Send' button
+to send a detected("spin") signal to the QtSensors.emulator plugin.
+
+You do not even need to wait for the recognizer plugin to be written!
+
+\section1 Developing sensor gesture plugins.
+
+Once the recognizer is written, the scripting facility may be used in the Emulator
+to script the sensors to trigger your custom plugins signals.
+
+A sensor gesture script for the 'turnover' gesture looks like this:
+
+\code
+// simulate turnover gesture
+
+//set the phone FaceUp
+sensors.accelerometerX = 0
+sensors.accelerometerZ = 9.8
+sensors.accelerometerY = 0
+yield(100)
+
+
+// set the phone FaceDown
+sensors.accelerometerZ = -9.8
+
+// set the Proximity to close
+sensors.proximitySensorClose = true
+
+\endcode
+
+This will cause the simulator sensor plugin to send these signals to a real recognizer plugin
+as real QAccelerometer and QProximity sensor values.
+
+*/
diff --git a/doc/src/qtsensors-cpp.qdoc b/doc/src/qtsensors-cpp.qdoc
index 79f1ed6e..ecb54b43 100644
--- a/doc/src/qtsensors-cpp.qdoc
+++ b/doc/src/qtsensors-cpp.qdoc
@@ -36,14 +36,14 @@
On a device there can be many types of sensors. Not all of the types that the QtSensors API
supports may be available. There may also be types available that are not defined in the
-QtSensors API. You can find the sensor types available on a device using the
+QtSensors API. The types of sensors available on a device is found using the
\l QSensor::sensorTypes() function.
For a list of built-in sensor types, see the \l{Sensor Classes} section below.
\section1 Common Conventions
-Unless otherwise specified, QtSensors shall use the
+Unless otherwise specified, QtSensors uses the
\l{http://en.wikipedia.org/wiki/Cartesian_coordinate_system}{Right Hand Cartesian coordinate system}.
\image sensors-coordinates.jpg
@@ -65,7 +65,7 @@ sensor.
\section1 Using a Sensor
-The life cycle of a sensor is typically:
+The life cycle of a QSensor is typically:
\list
\o Create an instance of QSensor or one of its sub-classes on the stack or heap.
diff --git a/doc/src/qtsensors.qdoc b/doc/src/qtsensors.qdoc
index ec7d9d2b..84187414 100644
--- a/doc/src/qtsensors.qdoc
+++ b/doc/src/qtsensors.qdoc
@@ -77,13 +77,15 @@
\section1 Information for QtSensorGestures API
+ QtSensorGestures provides a motion gesture recognition API for devices.
+
\table
\row
+ \o \l {SensorGesture}{QML API}
+ \o Information about the QtSensorGestures QML API
+ \row
\o \l {QtSensorGestures C++ API}{C++ API}
\o Information about the QtSensorGestures C++ API
- \row
- \o \l {C++ Sensor Gestures Example}
- \o The SensorGestures example demostrates how to use QSensorGestures
\endtable
\section1 Information for QtSensorGestures Recognizer Plugin Implementors.
@@ -92,7 +94,9 @@
\row
\o \l {QtSensorGestures Plugins}{Plugins}
\o Information about the QtSensorGestures recognizer plugins.
-
+ \row
+ \o \l {QtSensorGestures Emulator}{Emulator}
+ \o Information about QtSensorGestures use in the Emulator.
\endtable
*/
diff --git a/examples/sensors/sensorgestures/mainwindow.h b/examples/sensors/sensorgestures/mainwindow.h
index 18aa90bb..1e38f1be 100644
--- a/examples/sensors/sensorgestures/mainwindow.h
+++ b/examples/sensors/sensorgestures/mainwindow.h
@@ -43,7 +43,7 @@
#include <QtWidgets/QMainWindow>
#include <qsensorgesture.h>
-
+QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
@@ -70,4 +70,7 @@ private slots:
void on_stopPushButton_clicked();
};
+
+QT_END_NAMESPACE
+
#endif // MAINWINDOW_H
diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro
index f09991c1..a6e1636b 100644
--- a/examples/sensors/sensors.pro
+++ b/examples/sensors/sensors.pro
@@ -6,6 +6,6 @@ SUBDIRS += \
qmlsensorgestures \
sensor_explorer
-contains(QT_CONFIG,widgets):SUBDIRS += \
+!isEmpty(QT.widgets.name): SUBDIRS += \
sensorgestures
diff --git a/examples/sensors/shakeit/shakeit.qdoc b/examples/sensors/shakeit/shakeit.qdoc
index 34a712d8..409077d8 100644
--- a/examples/sensors/shakeit/shakeit.qdoc
+++ b/examples/sensors/shakeit/shakeit.qdoc
@@ -59,4 +59,7 @@
\snippet ../examples/sensors/shakeit/shakeit.qml 4
+ There are additional gestures to shake which are supported:
+ whip, twistRight, hover, cover, turnover and pickup.
+
*/
diff --git a/src/sensors/qirproximitysensor.cpp b/src/sensors/qirproximitysensor.cpp
index 95230068..2aedfafb 100644
--- a/src/sensors/qirproximitysensor.cpp
+++ b/src/sensors/qirproximitysensor.cpp
@@ -60,16 +60,16 @@ IMPLEMENT_READING(QIRProximityReading)
\section2 QIRProximityReading Units
- The sensor reports reflectance as a percentage. That is, 0 indicates nothing was detected
- within the range of the sensor and 100 indicates the infra-red signal returned at the full
- power level that it was sent at.
+ The sensor reports reflectance as a decimal fraction in the range of 0 - 1. That is, 0 indicates
+ nothing was detected within the range of the sensor and 1 indicates the infra-red signal
+ returned at the full power level that it was sent at.
*/
/*!
\property QIRProximityReading::reflectance
\brief Holds the reflectance value.
- The reflectance is a percentage (from 0 to 100) indicating how much of the transmitted
+ The reflectance is a decimal fraction (from 0 to 1) indicating how much of the transmitted
infra-red light was returned.
\sa {QIRProximityReading Units}