From 17d908ba5205513e9ed0be33aebeb3736bda0326 Mon Sep 17 00:00:00 2001 From: Wolfgang Beck Date: Thu, 17 May 2012 12:27:18 +1000 Subject: Unfork the examples. Some examples were forked off and updated. Unfork by bringing these changes back (a later update will bring the other examples in line with this new style). The changes are primarily made up of file renaming. Also, JPG files have been converted to PNG. Some documentation updates have been done. Change-Id: Ib090abb5ebea2003d479d2336a23317f52b8c4d8 Reviewed-by: Lincoln Ramsay --- doc/src/cubehouse.qdoc | 12 +++---- doc/src/examples/accelbubble.qdoc | 10 +++--- doc/src/examples/grue.qdoc | 14 ++++----- doc/src/examples/maze.qdoc | 19 ++++++------ doc/src/examples/qmlqtsensors.qdoc | 26 +++++++++------- doc/src/examples/sensor_explorer.qdoc | 57 +++++++++++++++++++--------------- doc/src/examples/sensorgestures.qdoc | 6 ++-- doc/src/examples/shakeit.qdoc | 41 ++++++++++++------------ doc/src/images/maze.jpg | Bin 38102 -> 0 bytes doc/src/images/maze.png | Bin 0 -> 215132 bytes doc/src/images/qmlqtsensors.jpg | Bin 26008 -> 0 bytes doc/src/images/qmlqtsensors.png | Bin 0 -> 82345 bytes doc/src/images/sensorexplorer.jpg | Bin 30397 -> 0 bytes doc/src/images/sensorexplorer.png | Bin 0 -> 83503 bytes doc/src/images/shakeit.jpg | Bin 8889 -> 0 bytes doc/src/images/shakeit.png | Bin 0 -> 29380 bytes doc/src/imports/qtsensors5.qdoc | 2 +- doc/src/qmlsensorgtestures.qdoc | 14 ++++----- doc/src/qtsensors-cpp.qdoc | 2 +- 19 files changed, 106 insertions(+), 97 deletions(-) delete mode 100644 doc/src/images/maze.jpg create mode 100644 doc/src/images/maze.png delete mode 100644 doc/src/images/qmlqtsensors.jpg create mode 100644 doc/src/images/qmlqtsensors.png delete mode 100644 doc/src/images/sensorexplorer.jpg create mode 100644 doc/src/images/sensorexplorer.png delete mode 100644 doc/src/images/shakeit.jpg create mode 100644 doc/src/images/shakeit.png (limited to 'doc') diff --git a/doc/src/cubehouse.qdoc b/doc/src/cubehouse.qdoc index 7555bb80..42bdd3d0 100644 --- a/doc/src/cubehouse.qdoc +++ b/doc/src/cubehouse.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example sensors/cubehouse + \example QtSensors/cubehouse \title Cube House QML Accelerometer example \ingroup qtsensors-examples \brief The Cube House example demonstrates the use of the accelerometer to drive a camera to create a pseudo-3D effect. @@ -37,24 +37,24 @@ Import the QtMobility.sensors declarative plugin: -\snippet ../examples/sensors/cubehouse/Cubehouse.qml 0 +\snippet ../examples/QtSensors/cubehouse/Cubehouse.qml 0 Add the Accelerometer QML elements into your qml file. -\snippet ../examples/sensors/cubehouse/Cubehouse.qml 1 +\snippet ../examples/QtSensors/cubehouse/Cubehouse.qml 1 In additional two properties are added to save the calculated pitch and roll values: -\snippet ../examples/sensors/cubehouse/Cubehouse.qml 2 +\snippet ../examples/QtSensors/cubehouse/Cubehouse.qml 2 Reading out the Accelerometer data can be done by implementing the 'onReadingChanged' slot and accessing the 'reading' property from the Accelerometer element: -\snippet ../examples/sensors/cubehouse/Cubehouse.qml 3 +\snippet ../examples/QtSensors/cubehouse/Cubehouse.qml 3 By using a timer the view can be rotated using the pitch and roll properties from the Accelerometer element: -\snippet ../examples/sensors/cubehouse/Cubehouse.qml 4 +\snippet ../examples/QtSensors/cubehouse/Cubehouse.qml 4 */ diff --git a/doc/src/examples/accelbubble.qdoc b/doc/src/examples/accelbubble.qdoc index 2d4bd88d..962bce67 100644 --- a/doc/src/examples/accelbubble.qdoc +++ b/doc/src/examples/accelbubble.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example sensors/accelbubble + \example QtSensors/accelbubble \title Accel Bubble \brief The AccelBubble example demonstrates the Legacy Accelerometer QML element. \ingroup qtsensors-examples @@ -36,19 +36,19 @@ Import the Legacy Sensors Declarative module. -\snippet ../examples/sensors/accelbubble/main.qml 0 +\snippet ../examples/QtSensors/accelbubble/main.qml 0 Add an Accelerometer QML element. -\snippet ../examples/sensors/accelbubble/main.qml 1 +\snippet ../examples/QtSensors/accelbubble/main.qml 1 The accelerometer might run too fast for what we need, so add a timer to read the accelerometer's readings. -\snippet ../examples/sensors/accelbubble/main.qml 2 +\snippet ../examples/QtSensors/accelbubble/main.qml 2 Use the 'active' property to start the sensor -\snippet ../examples/sensors/accelbubble/main.qml 3 +\snippet ../examples/QtSensors/accelbubble/main.qml 3 */ diff --git a/doc/src/examples/grue.qdoc b/doc/src/examples/grue.qdoc index 74283b07..a64528aa 100644 --- a/doc/src/examples/grue.qdoc +++ b/doc/src/examples/grue.qdoc @@ -57,7 +57,7 @@ */ /*! - \example sensors/grue/lib + \example QtSensors/grue/lib \title Grue Sensor Definition \brief The Grue sensor is defined in a library so that applications can use it. @@ -78,7 +78,7 @@ */ /*! - \example sensors/grue/plugin + \example QtSensors/grue/plugin \title Grue Sensor Implementation \brief The Grue sensor implementation lives in a plugin that is loaded by the Qt Sensors library. @@ -94,13 +94,13 @@ light sensor. In the start method, the backend should be sure to call the sensorStopped() or sensorBusy() methods if it cannot start. - \snippet ../examples/sensors/grue/plugin/gruesensorimpl.cpp start + \snippet ../examples/QtSensors/grue/plugin/gruesensorimpl.cpp start The setReading method is needed so that the sensors library knows where the readings are coming from. This backend has a local copy of the reading so it passes a pointer to the function. - \snippet ../examples/sensors/grue/plugin/gruesensorimpl.cpp setReading + \snippet ../examples/QtSensors/grue/plugin/gruesensorimpl.cpp setReading However it is also possible to pass null to the setReading method in which case the sensors library will create an instance and return a pointer. @@ -123,7 +123,7 @@ */ /*! - \example sensors/grue/console_app + \example QtSensors/grue/console_app \title Grue Sensor Console Application \brief The Grue sensor console application demonstrates use of the Grue sensor. @@ -135,7 +135,7 @@ */ /*! - \example sensors/grue/import + \example QtSensors/grue/import \title Grue Sensor QML Import \brief The Grue sensor QML import exports the GrueSensor class as a QML element. @@ -145,7 +145,7 @@ */ /*! - \example sensors/grue/qml_app + \example QtSensors/grue/qml_app \title Grue Sensor QML Application \brief The Grue sensor QML application demonstrates use of the GrueSensor QML element. diff --git a/doc/src/examples/maze.qdoc b/doc/src/examples/maze.qdoc index 3b89271b..ed2aeabc 100644 --- a/doc/src/examples/maze.qdoc +++ b/doc/src/examples/maze.qdoc @@ -26,32 +26,33 @@ ****************************************************************************/ /*! - \example sensors/maze - \title Maze example + \example QtSensors/QtSensors_maze + \title Qt Sensors - Maze QML Example \ingroup qtsensors-examples + \image maze.png + + \section2 Maze in QML \brief The Maze example demonstrates the TiltSensor QML element. - \image maze.jpg -\section1 Overview + To write a QML application that will use the TiltSensor QML sensors element you need to do the following steps: Import the QtSensors 5.x declarative plugin: -\snippet ../examples/sensors/maze/Maze.qml 0 + \snippet ../examples/QtSensors/QtSensors_maze/QtSensors_maze.qml 0 Add the Sensor QML elements into your qml file. In this example we use the TiltSensor with values based in degrees and an accuracy of 5 degree: -\snippet ../examples/sensors/maze/Maze.qml 1 + \snippet ../examples/QtSensors/QtSensors_maze/QtSensors_maze.qml 1 Starting the sensor can be done by setting the 'enabled' property to true: -\snippet ../examples/sensors/maze/Maze.qml 2 + \snippet ../examples/QtSensors/QtSensors_maze/QtSensors_maze.qml 2 To determine the walk direction of the mouse we use the following if -else statements: -\snippet ../examples/sensors/maze/Maze.qml 3 - + \snippet ../examples/QtSensors/QtSensors_maze/QtSensors_maze.qml 3 */ diff --git a/doc/src/examples/qmlqtsensors.qdoc b/doc/src/examples/qmlqtsensors.qdoc index d8173306..4c509392 100644 --- a/doc/src/examples/qmlqtsensors.qdoc +++ b/doc/src/examples/qmlqtsensors.qdoc @@ -26,43 +26,45 @@ ****************************************************************************/ /*! - \example sensors/qmlqtsensors - \title Qt Sensors - Simple QML Example + \example QtSensors/QtSensors_qmlqtsensors + \title Qt Sensors - QML example \ingroup qtsensors-examples - \brief The Qt Sensors simple QML example demonstrates the QML sensors elements in the QtSensors 5 import. - \image qmlqtsensors.jpg + \image qmlqtsensors.png + + \section2 Qt Sensors in QML + \brief The QML QtSensors example demonstrates the QML sensors elements in the QtSensors 5 import. + -\section1 Overview To write a QML application that will use the QML sensors elements in the QtSensors 5 import you need to to the following steps: Import the QtSensors 5.x declarative plugin: -\snippet ../examples/sensors/qmlqtsensors/main.qml 0 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 0 Add the Sensor QML elements into your qml file. In this example we use the TiltSensor: -\snippet ../examples/sensors/qmlqtsensors/main.qml 1 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 1 The Tilt-, AmbientLight- and the Proximity QML element sensor have the 'enabled' property in common. To start or stop the sensor set this property to true or false. -\snippet ../examples/sensors/qmlqtsensors/main.qml 2 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 2 Reading the data can be done for each sensor type like following: \l {QtSensors5::TiltSensor} {TiltSensor} -\snippet ../examples/sensors/qmlqtsensors/main.qml 3 -\snippet ../examples/sensors/qmlqtsensors/main.qml 4 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 3 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 4 \l {QtSensors5::AmbientLightSensor} {AmbientLightSensor} -\snippet ../examples/sensors/qmlqtsensors/main.qml 5 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 5 \l {QtSensors5::ProximitySensor} {ProximitySensor} -\snippet ../examples/sensors/qmlqtsensors/main.qml 6 + \snippet ../examples/QtSensors/QtSensors_qmlqtsensors/QtSensors_qmlqtsensors.qml 6 */ diff --git a/doc/src/examples/sensor_explorer.qdoc b/doc/src/examples/sensor_explorer.qdoc index d8c6a5f2..1f8e022c 100644 --- a/doc/src/examples/sensor_explorer.qdoc +++ b/doc/src/examples/sensor_explorer.qdoc @@ -26,60 +26,67 @@ ****************************************************************************/ /*! - \example sensors/sensor_explorer - \title Sensor Explorer example + \example QtSensors/QtSensors_sensor_explorer + \title Qt Sensors - Explorer QML example \ingroup qtsensors-examples - \brief The Sensor Explorer example demonstrates how to read the meta-data of available sensors. - \image sensorexplorer.jpg - -\section1 Overview - This example contains 2 projects. - - A \l{Sensor Explorer QML Import} to make the sensors and their meta-data available to a QML application. - - A \l{Sensor Explorer QML Application} that represents the \l{Sensor Explorer QML Import} information to the user interface. + \image sensorexplorer.png - \section1 Sensor Explorer QML Import + \section2 Sensor Explorer in QML + \brief The Sensor Explorer example demonstrates how to read the meta-data of available sensors. - The Sensor Explorer QML import exports the QSensorExplorer, QPropertyInfo and the QSensorItem class as a QML element. - This example creates the \e {Explorer 1.0} import. + This example is divided into two parts: - It consists of the code under the \c{import/} directory. + \list + \li A \l{Sensor Explorer QML Import}{C++ plug-in} that provides QML alternatives for QSensorExplorer, QPropertyInfo and the QSensorItem classes. + \li A QML Application that uses the QML alternatives to read the sensors meta-data and present it. + \endlist - \section1 Sensor Explorer QML Application This is a pure QML application that can be run from Qt Creator or directly using the - \c qmlscene binary. This app won't work if it cannot locate its related import. + \c qmlscene binary. You should install the other C++ plug-in before trying to run + this example, otherwise it will not find its dependencies. \code qmlscene main.qml \endcode -\section2 Overview To write a QML application that will use the Explorer QML element you need to do the following steps: Import the Explorer 1.0 declarative plugin: - \snippet ../examples/sensors/sensor_explorer/qml_app/main.qml 0 + \snippet ../examples/QtSensors/QtSensors_sensor_explorer/QtSensors_sensor_explorer.qml 0 Create a SensorExplorer QML item: - \snippet ../examples/sensors/sensor_explorer/qml_app/main.qml 1 + \snippet ../examples/QtSensors/QtSensors_sensor_explorer/QtSensors_sensor_explorer.qml 1 You can retrieve a list of all available sensors using the SensorExplorer: - \snippet ../examples/sensors/sensor_explorer/qml_app/main.qml 2 + \snippet ../examples/QtSensors/QtSensors_sensor_explorer/QtSensors_sensor_explorer.qml 2 To retrieve the properties of a SensorItem use: - \snippet ../examples/sensors/sensor_explorer/qml_app/main.qml 3 + \snippet ../examples/QtSensors/QtSensors_sensor_explorer/QtSensors_sensor_explorer.qml 3 Changing a property value can be done like: - \snippet ../examples/sensors/sensor_explorer/qml_app/main.qml 4 + \snippet ../examples/QtSensors/QtSensors_sensor_explorer/QtSensors_sensor_explorer.qml 4 + + Starting and stopping a sensor can be done like: - Starting and stoping a sesnor can be done like: + \snippet ../examples/QtSensors/QtSensors_sensor_explorer/QtSensors_sensor_explorer.qml 5 +*/ + +/*! + \example QtSensors/QtSensors_sensor_explorer/import + \title Sensor Explorer QML Import + + \section2 Sensor Explorer Declarative Plugin + \brief The Sensor Explorer QML import exports the QSensorExplorer, QPropertyInfo and the QSensorItem class as a QML element. - \snippet ../examples/sensors/sensor_explorer/qml_app/main.qml 5 + This example creates the \e {Explorer 1.0} import. + + \sa {Qt Sensors - Explorer QML example} */ + diff --git a/doc/src/examples/sensorgestures.qdoc b/doc/src/examples/sensorgestures.qdoc index 2fb1fe21..6da13c85 100644 --- a/doc/src/examples/sensorgestures.qdoc +++ b/doc/src/examples/sensorgestures.qdoc @@ -45,17 +45,17 @@ In order to know about custom signals that may be available, we need to ask the QSensorGestureManager about them, Using the QSensorGesture::gestureIds() function, the manager will return a QStringList of known and valid gesture Ids. - \snippet ../examples/sensors/sensorgestures/mainwindow.cpp 0 + \snippet ../examples/QtSensors/sensorgestures/mainwindow.cpp 0 We can then use this to create a QSensorGesture object that we can use to connect signals to, and start the detection process. A QSensorGesture object will take a list of one or more recognizer ids in it's constructor. - \snippet ../examples/sensors/sensorgestures/mainwindow.cpp 1 + \snippet ../examples/QtSensors/sensorgestures/mainwindow.cpp 1 and later stop the detection process. - \snippet ../examples/sensors/sensorgestures/mainwindow.cpp 2 + \snippet ../examples/QtSensors/sensorgestures/mainwindow.cpp 2 The QSensorGesture object will contain all the signals of the valid requested recognizers found on the system. diff --git a/doc/src/examples/shakeit.qdoc b/doc/src/examples/shakeit.qdoc index 409077d8..fca2a9dd 100644 --- a/doc/src/examples/shakeit.qdoc +++ b/doc/src/examples/shakeit.qdoc @@ -26,40 +26,39 @@ ****************************************************************************/ /*! - \example sensors/shakeit - \title ShakeIt! QML Sensor Gestures Example + \example QtSensors/QtSensors_shakeit + \title Qt Sensors - ShakeIt QML Example \ingroup qtsensors-examples + \image shakeit.png + + \section2 ShakeIt in QML \brief The sensor gesture example demonstrates the steps for creating a QML application that uses sensor gestures and the included shake sensor. - \image shakeit.jpg - - \section1 Overview - Writing a QML application that uses the Shake QML sensorgestures element - requires the following steps: - Import the Sensors Declarative module. + Writing a QML application that uses the Shake QML sensorgestures element requires the following steps: - \snippet ../examples/sensors/shakeit/shakeit.qml 0 + Import the Sensors Declarative module. - Add a SensorGesture QML element. + \snippet ../examples/QtSensors/QtSensors_shakeit/QtSensors_shakeit.qml 0 - \snippet ../examples/sensors/shakeit/shakeit.qml 1 + Add a SensorGesture QML element. - In the SensorGesture element, specify which gesture to be used. - Note that this can be a comma separated list. Here we are only interested in one - gesture recognizer. + \snippet ../examples/QtSensors/QtSensors_shakeit/QtSensors_shakeit.qml 1 - \snippet ../examples/sensors/shakeit/shakeit.qml 2 + In the SensorGesture element, specify which gesture to be used. + Note that this can be a comma separated list. Here we are only interested in one + gesture recognizer. - Use the 'enabled' property to start the sensor gesture. + \snippet ../examples/QtSensors/QtSensors_shakeit/QtSensors_shakeit.qml 2 - \snippet ../examples/sensors/shakeit/shakeit.qml 3 + Use the 'enabled' property to start the sensor gesture. - Use the onDetected signal to do stuff. + \snippet ../examples/QtSensors/QtSensors_shakeit/QtSensors_shakeit.qml 3 - \snippet ../examples/sensors/shakeit/shakeit.qml 4 + Use the onDetected signal to do stuff. - There are additional gestures to shake which are supported: - whip, twistRight, hover, cover, turnover and pickup. + \snippet ../examples/QtSensors/QtSensors_shakeit/QtSensors_shakeit.qml 4 + There are additional gestures to shake which are supported: + whip, twistRight, hover, cover, turnover and pickup. */ diff --git a/doc/src/images/maze.jpg b/doc/src/images/maze.jpg deleted file mode 100644 index 1d6b9ccc..00000000 Binary files a/doc/src/images/maze.jpg and /dev/null differ diff --git a/doc/src/images/maze.png b/doc/src/images/maze.png new file mode 100644 index 00000000..f3ad8de4 Binary files /dev/null and b/doc/src/images/maze.png differ diff --git a/doc/src/images/qmlqtsensors.jpg b/doc/src/images/qmlqtsensors.jpg deleted file mode 100644 index 7154362f..00000000 Binary files a/doc/src/images/qmlqtsensors.jpg and /dev/null differ diff --git a/doc/src/images/qmlqtsensors.png b/doc/src/images/qmlqtsensors.png new file mode 100644 index 00000000..0a54b653 Binary files /dev/null and b/doc/src/images/qmlqtsensors.png differ diff --git a/doc/src/images/sensorexplorer.jpg b/doc/src/images/sensorexplorer.jpg deleted file mode 100644 index 81515ca0..00000000 Binary files a/doc/src/images/sensorexplorer.jpg and /dev/null differ diff --git a/doc/src/images/sensorexplorer.png b/doc/src/images/sensorexplorer.png new file mode 100644 index 00000000..e9cda7ac Binary files /dev/null and b/doc/src/images/sensorexplorer.png differ diff --git a/doc/src/images/shakeit.jpg b/doc/src/images/shakeit.jpg deleted file mode 100644 index 8df4b44d..00000000 Binary files a/doc/src/images/shakeit.jpg and /dev/null differ diff --git a/doc/src/images/shakeit.png b/doc/src/images/shakeit.png new file mode 100644 index 00000000..5ca1b58c Binary files /dev/null and b/doc/src/images/shakeit.png differ diff --git a/doc/src/imports/qtsensors5.qdoc b/doc/src/imports/qtsensors5.qdoc index fc172aed..c3e6a2a0 100644 --- a/doc/src/imports/qtsensors5.qdoc +++ b/doc/src/imports/qtsensors5.qdoc @@ -55,7 +55,7 @@ The emulator supports simulating the Ambient Light, Orientation, Compass and Proximity sensors. - The \l {Qt Sensors - Simple QML Example} contains code for using the the \l TiltSensor, \l AmbientLightSensor + The \l {Qt Sensors - QML example} contains code for using the the \l TiltSensor, \l AmbientLightSensor and ProximitySensor elements. \section1 QML Elements diff --git a/doc/src/qmlsensorgtestures.qdoc b/doc/src/qmlsensorgtestures.qdoc index 317105a7..a384d266 100644 --- a/doc/src/qmlsensorgtestures.qdoc +++ b/doc/src/qmlsensorgtestures.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example sensors/qmlsensorgestures/qml_app + \example QtSensors/qmlsensorgestures/qml_app \title SensorGesture QML Element example \ingroup qtsensors-examples @@ -37,27 +37,27 @@ Import the QtSensors 5.x declarative plugin: -\snippet ../examples/sensors/qmlsensorgestures/qml_app/GestureView.qml 0 +\snippet ../examples/QtSensors/qmlsensorgestures/qml_app/GestureView.qml 0 Add the SensorGesture QML element into your qml file. -\snippet ../examples/sensors/qmlsensorgestures/qml_app/GestureView.qml 1 +\snippet ../examples/QtSensors/qmlsensorgestures/qml_app/GestureView.qml 1 Each SensorGesture QML element contains a property called gestures. In this example an alias 'gestureid' for this property is used. -\snippet ../examples/sensors/qmlsensorgestures/qml_app/GestureView.qml 2 +\snippet ../examples/QtSensors/qmlsensorgestures/qml_app/GestureView.qml 2 By using this alias property you define which gestures should be used: -\snippet ../examples/sensors/qmlsensorgestures/qml_app/Gesture.qml 3 +\snippet ../examples/QtSensors/qmlsensorgestures/qml_app/Gesture.qml 3 A list of all available gestures can be created by calling the 'availableGestures' property: -\snippet ../examples/sensors/qmlsensorgestures/qml_app/GestureList.qml 4 +\snippet ../examples/QtSensors/qmlsensorgestures/qml_app/GestureList.qml 4 -\sa {ShakeIt! QML Sensor Gestures Example} +\sa {Qt Sensors - ShakeIt QML Example} \sa {Qt Sensor Gestures} */ diff --git a/doc/src/qtsensors-cpp.qdoc b/doc/src/qtsensors-cpp.qdoc index 3df97f94..6cdd6a4b 100644 --- a/doc/src/qtsensors-cpp.qdoc +++ b/doc/src/qtsensors-cpp.qdoc @@ -101,7 +101,7 @@ This code does not require any compile-time links to \l QAccelerometer or \snippet snippets/sensors/start.cpp Starting a sensor -You can discover all of this information at runtime too. The sensor_explorer example +You can discover all of this information at runtime too. The QtSensors_sensor_explorer example shows you information about available sensors. \section1 Front end, back end -- cgit v1.2.3