diff options
-rw-r--r-- | doc/src/imports/qtsensors5.qdoc | 54 | ||||
-rw-r--r-- | doc/src/qtsensors.qdoc | 2 | ||||
-rw-r--r-- | src/imports/sensors/sensors.cpp | 24 | ||||
-rw-r--r-- | src/imports/sensors2/qsensor2ambientlight.cpp | 13 | ||||
-rw-r--r-- | src/imports/sensors2/qsensor2common.cpp | 4 | ||||
-rw-r--r-- | src/imports/sensors2/qsensor2gesture.cpp | 24 | ||||
-rw-r--r-- | src/imports/sensors2/qsensor2proximity.cpp | 11 | ||||
-rw-r--r-- | src/imports/sensors2/qsensor2tilt.cpp | 17 |
8 files changed, 78 insertions, 71 deletions
diff --git a/doc/src/imports/qtsensors5.qdoc b/doc/src/imports/qtsensors5.qdoc index c889868..5436ea2 100644 --- a/doc/src/imports/qtsensors5.qdoc +++ b/doc/src/imports/qtsensors5.qdoc @@ -32,49 +32,31 @@ \section1 Overview - The identifying string for this component is \e QtSensors. - 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 the receiving of sensor events and reading current values from the - sensors. + Mobile devices contains sensor hardware that allow detecting changes in various physical + properties of the device itself or its immediate environment. Examples of device properties + include the angle at which the device is held, whereas environmental properties include for + example the current level of ambient light. - The plugin contains many sensor types and properties to read values. - As an example, consider the tilt sensor. The \l {QML Qt Sensors example} - simply displays text on-screen to show the current tilt value. + These properties can be either actual values, such as the tilt angle in + degrees, or approximations, like the enumeration describing brightness in + relative terms using values such as AmbientLightSensor.Dark and AmbientLightSensor.Bright. - 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. + The latter type of value is also based on a natural phenomenon (in the case + of the ambient light sensor, the amount of visible light emitted by a source), but the value + itself is descriptive instead of using any effective unit of measurement, such as lumen. - \qml - TiltSensor { - id: tilt - enabled: false - unit: TiltSensor.Degrees - accuracy: 1.0 - } - \endqml + The identifying string for this component is \e QtSensors. + Use this in the QML import statement, as such: \e import QtSensors 5.0 - \qml - Text { - x:5 - y:160 - text: "X Rotation: " + tilt.xRotation - } - \endqml + Qt Sensors QML API provides an easy to use interface to the Qt Sensors API. + It enables the receiving of sensor events and reading current values from the + sensors. - \qml - Text { - x:5 - y:180 - text: "Y Rotation: " + tilt.yRotation - } + The emulator supports simulating the Ambient Light, Orientation, Compass and Proximity sensors. - \endqml + The \l {QML Qt Sensors example} contains code for using the the \l TiltSensor, \l AmbientLightSensor + and ProximitySensor elements. \section1 QML Elements diff --git a/doc/src/qtsensors.qdoc b/doc/src/qtsensors.qdoc index f67410c..925bc5a 100644 --- a/doc/src/qtsensors.qdoc +++ b/doc/src/qtsensors.qdoc @@ -31,7 +31,7 @@ \brief The Qt Sensors API provides access to sensors via QML and C++ interfaces. \ingroup technology-apis - The Qt Sensors API provides access to sensors via QML and C++ interfaces. + The Qt Sensors API provides access to sensor hardware via QML and C++ interfaces. \section1 Information for Application Writers diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp index 4943d17..b81bdd3 100644 --- a/src/imports/sensors/sensors.cpp +++ b/src/imports/sensors/sensors.cpp @@ -190,7 +190,7 @@ QT_END_NAMESPACE // ===================================================================== /*! - \qmlclass Sensor QSensor + \qmlclass QtMobility.sensors1::Sensor QSensor \inqmlmodule QtMobility.sensors 1 \brief The Sensor element serves as a base type for sensors. @@ -254,7 +254,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass Accelerometer QAccelerometer + \qmlclass QtMobility.sensors1::Accelerometer QAccelerometer \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -313,7 +313,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass AmbientLightSensor QAmbientLightSensor + \qmlclass QtMobility.sensors1::AmbientLightSensor QAmbientLightSensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -370,7 +370,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass Compass QCompass + \qmlclass QtMobility.sensors1::Compass QCompass \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -422,7 +422,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass Magnetometer QMagnetometer + \qmlclass QtMobility.sensors1::Magnetometer QMagnetometer \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -486,7 +486,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass OrientationSensor QOrientationSensor + \qmlclass QtMobility.sensors1::OrientationSensor QOrientationSensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -543,7 +543,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass ProximitySensor QProximitySensor + \qmlclass QtMobility.sensors1::ProximitySensor QProximitySensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -590,7 +590,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass RotationSensor QRotationSensor + \qmlclass QtMobility.sensors1::RotationSensor QRotationSensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -649,7 +649,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass TapSensor QTapSensor + \qmlclass QtMobility.sensors1::TapSensor QTapSensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \inherits QtMobility.sensors1::Sensor @@ -713,7 +713,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass LightSensor QLightSensor + \qmlclass QtMobility.sensors1::LightSensor QLightSensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \since QtMobility.sensors 1.2 @@ -762,7 +762,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass Gyroscope QGyroscope + \qmlclass QtMobility.sensors1::Gyroscope QGyroscope \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \since QtMobility.sensors 1.2 @@ -820,7 +820,7 @@ QT_END_NAMESPACE */ /*! - \qmlclass IRProximitySensor QIRProximitySensor + \qmlclass QtMobility.sensors1::IRProximitySensor QIRProximitySensor \ingroup qml-sensors_type \inqmlmodule QtMobility.sensors 1 \since QtMobility.sensors 1.3 diff --git a/src/imports/sensors2/qsensor2ambientlight.cpp b/src/imports/sensors2/qsensor2ambientlight.cpp index 6a4fe0e..ae4f54d 100644 --- a/src/imports/sensors2/qsensor2ambientlight.cpp +++ b/src/imports/sensors2/qsensor2ambientlight.cpp @@ -50,9 +50,14 @@ QT_BEGIN_NAMESPACE \inqmlmodule QtSensors 5 \ingroup qml-QtSensors5 \since QtSensors 5.0 - \brief The AmbientLightSensor element provides easy access to determine the ambient light by using the ambient light sensor. + \brief Provides access to the current ambient light level. + + This element provides easy access to determine the ambient light by using the ambient light sensor. + For example brightening the screen according to whether the device is in full sunlight or not. This element is part of the \b{QtSensors 5} module. + + The \l {QML Qt Sensors example} is an example how to use this QML element. */ QSensor2AmbientLight::QSensor2AmbientLight(QObject* parent) : qsensor2common(parent) @@ -83,13 +88,13 @@ QSensor2AmbientLight::~QSensor2AmbientLight() \li It is moderately dark. \row \li AmbientLightSensor.Light - \li It is light (eg. internal lights). + \li It is light (internal lights). \row \li AmbientLightSensor.Bright - \li It is bright (eg. outside but in the shade). + \li It is bright (outside but in the shade). \row \li AmbientLightSensor.Sunny - \li It is very bright (eg. direct sunlight). + \li It is very bright (direct sunlight). \endtable */ QSensor2AmbientLight::LightLevel QSensor2AmbientLight::lightLevel() diff --git a/src/imports/sensors2/qsensor2common.cpp b/src/imports/sensors2/qsensor2common.cpp index 4c66d01..2deb94f 100644 --- a/src/imports/sensors2/qsensor2common.cpp +++ b/src/imports/sensors2/qsensor2common.cpp @@ -66,7 +66,7 @@ qsensor2common::~qsensor2common() /*! \qmlproperty bool QtSensors5::Sensor::enabled - Starts or stops the sensor. + Starts or stops the sensor. Default value is false. */ bool qsensor2common::enabled() @@ -91,7 +91,7 @@ void qsensor2common::setEnabled(bool val) /*! \qmlproperty bool QtSensors5::Sensor::alwaysOn - Keeps the sensor running when the screen turns off. + Keeps the sensor running when the screen turns off. Default value is false. */ bool qsensor2common::alwaysOn() diff --git a/src/imports/sensors2/qsensor2gesture.cpp b/src/imports/sensors2/qsensor2gesture.cpp index ef17c3f..14690f3 100644 --- a/src/imports/sensors2/qsensor2gesture.cpp +++ b/src/imports/sensors2/qsensor2gesture.cpp @@ -51,11 +51,17 @@ QT_BEGIN_NAMESPACE \qmlclass SensorGesture QSensor2Gesture \inqmlmodule QtSensors 5 \since QtSensors 5.0 - \brief The SensorGesture element provides notification when sensor gestures are triggered. + \brief Provides notifications when sensor-based gestures are detected. + + This element provides notification when sensor gestures are triggered. This element is part of the \b{QtSensors 5} module. - The following QML code creates a "shake" and "template" SensorGesture QML element. + The following QML code creates a "shake" and "template" SensorGesture QML element, and + displays the detected gesture in a text element. + + QtSensors.shake gesture is available with the Qt Sensors API, but the QtSensors.SecondCounter + sensor gesture is provided as example code for the \l {SensorGesture QML Element example} \qml Item { @@ -76,8 +82,9 @@ QT_BEGIN_NAMESPACE } \endqml -A list of currently supported sensor gestures and their descriptions can be found here: -\l {Qt Sensor Gestures} + \l {Qt Sensor Gestures} contains a list of currently supported sensor gestures and their + descriptions. + */ QSensor2Gesture::QSensor2Gesture(QObject* parent) @@ -125,11 +132,11 @@ QStringList QSensor2Gesture::availableGestures() } /*! - \qmlproperty string QtSensors5::SensorGesture::gestures - Set this property to the gestures the application is interested in detecting. - The properties validGestures and invalidGestures will be set as appropriate immediately. - The list of available gestures can be found in the availableGestures property. + \qmlproperty stringlist QtSensors5::SensorGesture::gestures + Set this property to a list of the gestures that the application is interested in detecting. This property cannot be changed while the element is enabled. + + The properties validGestures and invalidGestures will be set as appropriate immediately. To determine all available getures on the system please use the \l {QtSensors5::SensorGesture::availableGestures} {availableGestures} property. @@ -181,6 +188,7 @@ QStringList QSensor2Gesture::invalidGestures() const /*! \qmlproperty bool QtSensors5::SensorGesture::enabled This property can be used to activate or deactivate the sensor gesture. + Default value is false; \sa {QtSensors5::SensorGesture::detected} {detected} */ bool QSensor2Gesture::enabled() const diff --git a/src/imports/sensors2/qsensor2proximity.cpp b/src/imports/sensors2/qsensor2proximity.cpp index ac2cf30..7433e80 100644 --- a/src/imports/sensors2/qsensor2proximity.cpp +++ b/src/imports/sensors2/qsensor2proximity.cpp @@ -50,9 +50,15 @@ QT_BEGIN_NAMESPACE \inqmlmodule QtSensors 5 \ingroup qml-QtSensors5 \since QtSensors 5.0 - \brief The ProximitySensor element provides an easy access to determine if the proximity of the mobile user by using the proximity sensor. + \brief Provides access to the proximity sensor. + + This element allows determining if something is held in close proximity to the device, such + as determining if the user is holding the device to their ear. This element is part of the \b{QtSensors 5} module. + + The \l {QML Qt Sensors example} is an example how to use this QML element. + */ QSensor2Proximity::QSensor2Proximity(QObject* parent) @@ -70,7 +76,8 @@ QSensor2Proximity::~QSensor2Proximity() /*! \qmlproperty bool QtSensors5::ProximitySensor::near This property holds whether the sensor has detected something in close proximity. - Device dependent, but typically 1-2 cm. + The definition of close proximity is device dependent, but it + typically stands for a distance of 1-2 cm. */ bool QSensor2Proximity::near() { diff --git a/src/imports/sensors2/qsensor2tilt.cpp b/src/imports/sensors2/qsensor2tilt.cpp index f1d8a6a..8593f6d 100644 --- a/src/imports/sensors2/qsensor2tilt.cpp +++ b/src/imports/sensors2/qsensor2tilt.cpp @@ -55,9 +55,16 @@ QT_BEGIN_NAMESPACE \inqmlmodule QtSensors 5 \ingroup qml-QtSensors5 \since QtSensors 5.0 - \brief The TiltSensor element provides tilt datas from x and y rotation of the device using the accelerometer sensor. + \brief Provides access to the current X and Y axis rotation angles of the device. + + This element provides tilt data from the rotation around the x and y axis of the device using + the accelerometer sensor. Like for a marble and maze game, where the marble is rolled + around the screen according to the user tilting the device. This element is part of the \b{QtSensors 5} module. + + The \l {QML Qt Sensors example} is an example how to use this QML element. + */ QSensor2Tilt::QSensor2Tilt(QObject* parent) : qsensor2common(parent) @@ -285,13 +292,11 @@ inline qreal calcRoll(double Ax, double Ay, double Az) This property contains the accuracy (in degrees) in which the rotation should be measured. This can be used to minimize signal emiting and therefore saving of performance. Default value is 1 degree. - The accuracy value is unsigned and works clockwise and anti-clockwise in X and Y axis rotation directions. - Accuracy range can be 0 to 90 degrees. - - - E.g. + The accuracy value is unsigned and works clockwise and counterclockwise in X and Y axis rotation + directions. Accuracy range can be 0 to 90 degrees. + For example: Accuracy 5.5 will notify the client application about an rotation change only if the rotation angle over the X and / or Y axis was changed by 5.5 or more degrees clockwise or anti-clockwise. \table |