diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-09-27 16:34:20 +1000 |
---|---|---|
committer | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-10-10 09:25:31 +1000 |
commit | 7553fe500a0059ca2975e291b9acde6e372c002d (patch) | |
tree | 9f07560a699b9b5458b52455ce409d3c35adc453 /doc/src/imports | |
parent | 2ae28157cc76180fd79765f612deece7974d5c0e (diff) |
Getting some structure into the sensors docs.
QtSensors is a landing page (from the Modules index).
There's a QtSensors Examples page that has all the examples on it.
The QtSensors page links off to the C++ and QML API pages.
More to do but this is a good start.
Change-Id: I2b795a759490e712137024101a630193d2d26033
Reviewed-on: http://codereview.qt-project.org/5589
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'doc/src/imports')
-rw-r--r-- | doc/src/imports/qml-sensors.qdoc | 99 | ||||
-rw-r--r-- | doc/src/imports/qtmobilitysensors1.qdoc | 73 | ||||
-rw-r--r-- | doc/src/imports/qtsensors5.qdoc (renamed from doc/src/imports/qml-qtsensors5.qdoc) | 34 |
3 files changed, 78 insertions, 128 deletions
diff --git a/doc/src/imports/qml-sensors.qdoc b/doc/src/imports/qml-sensors.qdoc deleted file mode 100644 index e547daa9..00000000 --- a/doc/src/imports/qml-sensors.qdoc +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** 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 qml-sensors - \title QML Sensors API Plugin - QML Support for the QtMobility Project Sensors API. -*/ - -/*! - \page qml-sensors.html - - \title Sensors QML Plugin - - \brief A QML plugin for the QtMobility Project Sensors API. - - \section1 Overview - - The QML Sensors Plugin provides an easy to use interface to the Sensors API. - It enables us to receive sensor events and to read current values from - sensors. - - The plugin contains many sensor types and access functions to read values - from them. As an example consider the orientation sensor. The orientation - example simply displays text on-screen to show the current orientation. - - The QML code that reads the value is quite simple. Here we see a QML component - \i orientation declared which is an \l OrientationSensor element. First - the sensor is started by setting the \l {Sensor::active}{active} property - to \i true. The element receives a signal when the reading changes and it - is picked up by the \i onReadingChanged slot. Now the - \l {OrientationSensor::reading}{reading} property of this element can be - used to extract the current orientation so that it can be compared against - the defined values of various orientations in the \l OrientationReading - element. - - \qml - OrientationSensor { - id: orientation - active: true - - onReadingChanged: { - - if (reading.orientation == OrientationReading.FaceUp) - content.state = "FaceUp"; - - // ... more tests for different orientations ... - } - } - - \endqml - - Other sensors can be treated in a similar manner. For example, the \l Compass - sensor could have almost identical coding - - \qml - Compass { - id: compass - active: true - - onReadingChanged: { - compassHeading.text = reading.azimuth; - - // ... - } - } - \endqml - - \section1 QML Elements - \annotatedlist qml-sensors_type - \annotatedlist qml-sensors_reading - -*/ - - diff --git a/doc/src/imports/qtmobilitysensors1.qdoc b/doc/src/imports/qtmobilitysensors1.qdoc new file mode 100644 index 00000000..341eb7e2 --- /dev/null +++ b/doc/src/imports/qtmobilitysensors1.qdoc @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** 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$ +** +****************************************************************************/ + +/*! + \qmlmodule QtMobility.sensors 1 + \title QtMobility.sensors 1.x + \brief Legacy QML import for QtSensors + \ingroup qtsensors + + \section1 Overview + + The identifying string for this component is \e {"QtMobility.sensors"}. + Use this in the QML \e {import} statement. + + The Sensors QML Plugin registers the C++ Sensors classes directly to the QML environment. + This causes some limitations due to the use of types that do not work in the QML environment. + See \l{Sensors QML Limitations}{below} for a list of the known limitations. + + See \l QtSensors for more information about the Sensors API. + + \section1 Sensors QML Limitations + + The following limitations affect the Sensors QML bindings for Qt Mobility 1.1 and 1.2. + + \list 1 + \o The QSensor::sensorid property cannot be set because QML does not support QByteArray. + This means that it is not possible to specify a particular sensor when two or more have + been registered with the same type. + \o The QSensor::availableDataRates property cannot be used because QML does not support \l qrangelist. + \o The QSensor::outputRanges property cannot be used because QML does not support \l qoutputrangelist. + \o The QLightSensor::fieldOfView property cannot be used because QML cannot access dynamic properties. + \o The QMagnetometer::returnGeoValues property cannot be used because QML cannot access dynamic properties. + \o The QRotationSensor::hasZ property cannot be used because QML cannot access dynamic properties. + \o The QTapSensor::returnDoubleTapEvents property cannot be used because QML cannot access dynamic properties. + \endlist + + \section1 QML Sensor Elements + + These elements represent specific types of sensors. + + \annotatedlist qml-sensors_type + + \section1 QML Reading Elements + + The data from a sensor comes through a reading class. + + \annotatedlist qml-sensors_reading +*/ + diff --git a/doc/src/imports/qml-qtsensors5.qdoc b/doc/src/imports/qtsensors5.qdoc index 39407a55..ed28985c 100644 --- a/doc/src/imports/qml-qtsensors5.qdoc +++ b/doc/src/imports/qtsensors5.qdoc @@ -27,32 +27,14 @@ /*! \qmlmodule QtSensors 5 - \title Sensors QML Plugin for Qt 5 - \brief A QML plugin for the Qt 5 Project Sensors API. -*/ - -/*! - \page qmlqtsensors5.html - \title Sensors 5 QML Plugin example - \example qmlqtsensors5 -*/ - -/*! - \page maze.html - \title Sensors 5 QML TiltSensor example - \example maze -*/ - -/*! - \page qml-sensors5.html - \title Sensors 5 QML Plugin - - \brief A QML plugin for the Qt Project Sensors 5 API. + \title QtSensors 5.x + \brief The QML import for QtSensors + \ingroup qtsensors \section1 Overview - The identifying string for this component is \i {"QtSensors"}. - Use this in the QML \i {import} statement. + The identifying string for this component is \e QtSensors. + Use this in the QML \e import statement. 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 @@ -97,13 +79,7 @@ \endqml \section1 QML Elements - \annotatedlist qml-QtSensors5 - - \section1 QML QtSensors Example - The \l {qmlqtsensors5}{qmlqtsensors5} example shows you how to use all those diferent QML elements. - \section1 Maze QML TiltSensor Example - The \l {maze}{maze} example shows you how to use the TiltSeonsor QML element. */ |