From 9d4d08421acb628e0115b140e54656fc779d13db Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 4 Oct 2012 13:48:23 +0200 Subject: Doc: Modularized the Qt Sensor Docs Change-Id: Ie8636ec443f43b1f238342e0f6f7d321e13dce09 Reviewed-by: Jerome Pasion --- doc/src/compatmap.qdoc | 142 ---------------- doc/src/examples/accelbubble.qdoc | 54 ------ doc/src/examples/cubehouse.qdoc | 60 ------- doc/src/examples/grue.qdoc | 162 ------------------ doc/src/examples/maze.qdoc | 67 -------- doc/src/examples/qmlqtsensors.qdoc | 70 -------- doc/src/examples/qmlsensorgtestures.qdoc | 63 ------- doc/src/examples/sensor_explorer.qdoc | 91 ---------- doc/src/examples/sensorgestures.qdoc | 67 -------- doc/src/examples/sensors.qdoc | 40 ----- doc/src/examples/shakeit.qdoc | 64 ------- doc/src/genericbackend.qdoc | 55 ------ doc/src/images/XAngle.gif | Bin 46224 -> 0 bytes doc/src/images/XAngleNegative.gif | Bin 38468 -> 0 bytes doc/src/images/YAngle.gif | Bin 44322 -> 0 bytes doc/src/images/YAngleNegative.gif | Bin 39741 -> 0 bytes doc/src/images/cubehouse.png | Bin 39408 -> 0 bytes doc/src/images/maze.png | Bin 215132 -> 0 bytes doc/src/images/qmlqtsensors.png | Bin 82345 -> 0 bytes doc/src/images/sensorgesture-cover.png | Bin 23183 -> 0 bytes doc/src/images/sensorgesture-doubletap.png | Bin 30073 -> 0 bytes doc/src/images/sensorgesture-facedown.png | Bin 17917 -> 0 bytes doc/src/images/sensorgesture-faceup.png | Bin 35115 -> 0 bytes doc/src/images/sensorgesture-flat.png | Bin 21828 -> 0 bytes doc/src/images/sensorgesture-hover.png | Bin 22512 -> 0 bytes doc/src/images/sensorgesture-shake.png | Bin 34512 -> 0 bytes doc/src/images/sensorgesture-slam_1.png | Bin 26212 -> 0 bytes doc/src/images/sensorgesture-slam_2.png | Bin 29763 -> 0 bytes doc/src/images/sensorgesture-twist.png | Bin 29643 -> 0 bytes doc/src/images/sensorgesture-whip.png | Bin 32058 -> 0 bytes doc/src/images/sensorgesturecpp.png | Bin 33013 -> 0 bytes doc/src/images/sensors-coordinates.jpg | Bin 43508 -> 0 bytes doc/src/images/sensors-coordinates2.jpg | Bin 58471 -> 0 bytes doc/src/images/sensors-coordinates3.jpg | Bin 47920 -> 0 bytes doc/src/images/sensors-dynamic.png | Bin 34911 -> 0 bytes doc/src/images/sensors-geo-vs-raw-magnetism.jpg | Bin 171856 -> 0 bytes doc/src/images/sensors-orientation.jpg | Bin 39716 -> 0 bytes doc/src/images/sensors-overview.png | Bin 9670 -> 0 bytes doc/src/images/sensors-rotation-anim.gif | Bin 296580 -> 0 bytes doc/src/images/sensors-rotation.jpg | Bin 36653 -> 0 bytes doc/src/images/sensors-rotation2.jpg | Bin 39953 -> 0 bytes doc/src/images/sensors-rotation3.jpg | Bin 31417 -> 0 bytes doc/src/images/sensors-sides.jpg | Bin 48614 -> 0 bytes doc/src/images/sensors-sides2.jpg | Bin 22706 -> 0 bytes doc/src/images/sensors-static.png | Bin 23472 -> 0 bytes doc/src/images/shakeit.png | Bin 29380 -> 0 bytes doc/src/imports/qtsensors5.qdoc | 69 -------- doc/src/porting.qdoc | 112 ------------- doc/src/qtsensorgestures-cpp.qdoc | 64 ------- doc/src/qtsensorgestures-emulator.qdoc | 51 ------ doc/src/qtsensorgestures-plugins.qdoc | 167 ------------------- doc/src/qtsensors-backend.qdoc | 184 --------------------- doc/src/qtsensors-cpp.qdoc | 150 ----------------- doc/src/qtsensors.qdoc | 109 ------------ doc/src/snippets/sensorgestures/creating.cpp | 73 -------- doc/src/snippets/sensorgestures/main.cpp | 45 ----- doc/src/snippets/sensorgestures/myplugin.h | 83 ---------- doc/src/snippets/sensorgestures/plugin.cpp | 100 ----------- doc/src/snippets/sensorgestures/sensorgestures.pro | 8 - doc/src/snippets/sensors/creating.cpp | 63 ------- doc/src/snippets/sensors/main.cpp | 45 ----- doc/src/snippets/sensors/mybackend.h | 58 ------- doc/src/snippets/sensors/plugin.cpp | 68 -------- doc/src/snippets/sensors/sensors.pro | 10 -- doc/src/snippets/sensors/start.cpp | 58 ------- doc/src/snippets/snippets.pro | 5 - examples/sensors/accel/accel.pro | 9 - examples/sensors/accel/main.cpp | 77 --------- .../sensors/accelbubble/doc/src/accelbubble.qdoc | 54 ++++++ examples/sensors/cubehouse/doc/src/cubehouse.qdoc | 60 +++++++ examples/sensors/grue/doc/src/grue.qdoc | 162 ++++++++++++++++++ examples/sensors/maze/doc/src/maze.qdoc | 67 ++++++++ .../sensors/qmlqtsensors/doc/src/qmlqtsensors.qdoc | 70 ++++++++ .../doc/src/qmlsensorgtestures.qdoc | 63 +++++++ .../sensor_explorer/doc/src/sensor_explorer.qdoc | 91 ++++++++++ .../sensorgestures/doc/images/sensorgesturecpp.png | Bin 0 -> 33013 bytes .../sensorgestures/doc/src/sensorgestures.qdoc | 67 ++++++++ examples/sensors/sensors.pro | 2 +- examples/sensors/shakeit/doc/images/shakeit.png | Bin 0 -> 29380 bytes examples/sensors/shakeit/doc/src/shakeit.qdoc | 64 +++++++ qtsensors.pro | 5 - src/sensors/doc/images/XAngle.gif | Bin 0 -> 46224 bytes src/sensors/doc/images/XAngleNegative.gif | Bin 0 -> 38468 bytes src/sensors/doc/images/YAngle.gif | Bin 0 -> 44322 bytes src/sensors/doc/images/YAngleNegative.gif | Bin 0 -> 39741 bytes src/sensors/doc/images/cubehouse.png | Bin 0 -> 39408 bytes src/sensors/doc/images/maze.png | Bin 0 -> 215132 bytes src/sensors/doc/images/qmlqtsensors.png | Bin 0 -> 82345 bytes src/sensors/doc/images/sensorgesture-cover.png | Bin 0 -> 23183 bytes src/sensors/doc/images/sensorgesture-doubletap.png | Bin 0 -> 30073 bytes src/sensors/doc/images/sensorgesture-facedown.png | Bin 0 -> 17917 bytes src/sensors/doc/images/sensorgesture-faceup.png | Bin 0 -> 35115 bytes src/sensors/doc/images/sensorgesture-flat.png | Bin 0 -> 21828 bytes src/sensors/doc/images/sensorgesture-hover.png | Bin 0 -> 22512 bytes src/sensors/doc/images/sensorgesture-shake.png | Bin 0 -> 34512 bytes src/sensors/doc/images/sensorgesture-slam_1.png | Bin 0 -> 26212 bytes src/sensors/doc/images/sensorgesture-slam_2.png | Bin 0 -> 29763 bytes src/sensors/doc/images/sensorgesture-twist.png | Bin 0 -> 29643 bytes src/sensors/doc/images/sensorgesture-whip.png | Bin 0 -> 32058 bytes src/sensors/doc/images/sensors-coordinates.jpg | Bin 0 -> 43508 bytes src/sensors/doc/images/sensors-coordinates2.jpg | Bin 0 -> 58471 bytes src/sensors/doc/images/sensors-coordinates3.jpg | Bin 0 -> 47920 bytes src/sensors/doc/images/sensors-dynamic.png | Bin 0 -> 34911 bytes .../doc/images/sensors-geo-vs-raw-magnetism.jpg | Bin 0 -> 171856 bytes src/sensors/doc/images/sensors-orientation.jpg | Bin 0 -> 39716 bytes src/sensors/doc/images/sensors-overview.png | Bin 0 -> 9670 bytes src/sensors/doc/images/sensors-rotation-anim.gif | Bin 0 -> 296580 bytes src/sensors/doc/images/sensors-rotation.jpg | Bin 0 -> 36653 bytes src/sensors/doc/images/sensors-rotation2.jpg | Bin 0 -> 39953 bytes src/sensors/doc/images/sensors-rotation3.jpg | Bin 0 -> 31417 bytes src/sensors/doc/images/sensors-sides.jpg | Bin 0 -> 48614 bytes src/sensors/doc/images/sensors-sides2.jpg | Bin 0 -> 22706 bytes src/sensors/doc/images/sensors-static.png | Bin 0 -> 23472 bytes src/sensors/doc/qtsensors.qdocconf | 47 ++++++ .../doc/snippets/sensorgestures/creating.cpp | 73 ++++++++ src/sensors/doc/snippets/sensorgestures/main.cpp | 45 +++++ src/sensors/doc/snippets/sensorgestures/myplugin.h | 83 ++++++++++ src/sensors/doc/snippets/sensorgestures/plugin.cpp | 100 +++++++++++ .../doc/snippets/sensorgestures/sensorgestures.pro | 8 + src/sensors/doc/snippets/sensors/creating.cpp | 63 +++++++ src/sensors/doc/snippets/sensors/main.cpp | 45 +++++ src/sensors/doc/snippets/sensors/mybackend.h | 58 +++++++ src/sensors/doc/snippets/sensors/plugin.cpp | 68 ++++++++ src/sensors/doc/snippets/sensors/sensors.pro | 10 ++ src/sensors/doc/snippets/sensors/start.cpp | 58 +++++++ src/sensors/doc/snippets/snippets.pro | 5 + src/sensors/doc/src/compatmap.qdoc | 142 ++++++++++++++++ src/sensors/doc/src/genericbackend.qdoc | 55 ++++++ src/sensors/doc/src/porting.qdoc | 121 ++++++++++++++ src/sensors/doc/src/qtmobilitysensors1.qdoc | 74 +++++++++ src/sensors/doc/src/qtsensorgestures-cpp.qdoc | 60 +++++++ src/sensors/doc/src/qtsensorgestures-emulator.qdoc | 51 ++++++ src/sensors/doc/src/qtsensorgestures-plugins.qdoc | 167 +++++++++++++++++++ src/sensors/doc/src/qtsensors-backend.qdoc | 184 +++++++++++++++++++++ src/sensors/doc/src/qtsensors-cpp.qdoc | 150 +++++++++++++++++ src/sensors/doc/src/qtsensors.qdoc | 117 +++++++++++++ src/sensors/doc/src/qtsensors5.qdoc | 78 +++++++++ src/sensors/doc/src/sensor-examples.qdoc | 40 +++++ src/sensors/gestures/qsensorgesturemanager.cpp | 2 +- src/sensors/qlightsensor.cpp | 2 +- src/sensors/qsensor.cpp | 3 +- src/sensors/qsensorbackend.cpp | 2 +- src/sensors/sensors.pro | 2 +- 143 files changed, 2607 insertions(+), 2554 deletions(-) delete mode 100644 doc/src/compatmap.qdoc delete mode 100644 doc/src/examples/accelbubble.qdoc delete mode 100644 doc/src/examples/cubehouse.qdoc delete mode 100644 doc/src/examples/grue.qdoc delete mode 100644 doc/src/examples/maze.qdoc delete mode 100644 doc/src/examples/qmlqtsensors.qdoc delete mode 100644 doc/src/examples/qmlsensorgtestures.qdoc delete mode 100644 doc/src/examples/sensor_explorer.qdoc delete mode 100644 doc/src/examples/sensorgestures.qdoc delete mode 100644 doc/src/examples/sensors.qdoc delete mode 100644 doc/src/examples/shakeit.qdoc delete mode 100644 doc/src/genericbackend.qdoc delete mode 100644 doc/src/images/XAngle.gif delete mode 100644 doc/src/images/XAngleNegative.gif delete mode 100644 doc/src/images/YAngle.gif delete mode 100644 doc/src/images/YAngleNegative.gif delete mode 100644 doc/src/images/cubehouse.png delete mode 100644 doc/src/images/maze.png delete mode 100644 doc/src/images/qmlqtsensors.png delete mode 100644 doc/src/images/sensorgesture-cover.png delete mode 100644 doc/src/images/sensorgesture-doubletap.png delete mode 100644 doc/src/images/sensorgesture-facedown.png delete mode 100644 doc/src/images/sensorgesture-faceup.png delete mode 100644 doc/src/images/sensorgesture-flat.png delete mode 100644 doc/src/images/sensorgesture-hover.png delete mode 100644 doc/src/images/sensorgesture-shake.png delete mode 100644 doc/src/images/sensorgesture-slam_1.png delete mode 100644 doc/src/images/sensorgesture-slam_2.png delete mode 100644 doc/src/images/sensorgesture-twist.png delete mode 100644 doc/src/images/sensorgesture-whip.png delete mode 100644 doc/src/images/sensorgesturecpp.png delete mode 100644 doc/src/images/sensors-coordinates.jpg delete mode 100644 doc/src/images/sensors-coordinates2.jpg delete mode 100644 doc/src/images/sensors-coordinates3.jpg delete mode 100644 doc/src/images/sensors-dynamic.png delete mode 100644 doc/src/images/sensors-geo-vs-raw-magnetism.jpg delete mode 100644 doc/src/images/sensors-orientation.jpg delete mode 100644 doc/src/images/sensors-overview.png delete mode 100644 doc/src/images/sensors-rotation-anim.gif delete mode 100644 doc/src/images/sensors-rotation.jpg delete mode 100644 doc/src/images/sensors-rotation2.jpg delete mode 100644 doc/src/images/sensors-rotation3.jpg delete mode 100644 doc/src/images/sensors-sides.jpg delete mode 100644 doc/src/images/sensors-sides2.jpg delete mode 100644 doc/src/images/sensors-static.png delete mode 100644 doc/src/images/shakeit.png delete mode 100644 doc/src/imports/qtsensors5.qdoc delete mode 100644 doc/src/porting.qdoc delete mode 100644 doc/src/qtsensorgestures-cpp.qdoc delete mode 100644 doc/src/qtsensorgestures-emulator.qdoc delete mode 100644 doc/src/qtsensorgestures-plugins.qdoc delete mode 100644 doc/src/qtsensors-backend.qdoc delete mode 100644 doc/src/qtsensors-cpp.qdoc delete mode 100644 doc/src/qtsensors.qdoc delete mode 100644 doc/src/snippets/sensorgestures/creating.cpp delete mode 100644 doc/src/snippets/sensorgestures/main.cpp delete mode 100644 doc/src/snippets/sensorgestures/myplugin.h delete mode 100644 doc/src/snippets/sensorgestures/plugin.cpp delete mode 100644 doc/src/snippets/sensorgestures/sensorgestures.pro delete mode 100644 doc/src/snippets/sensors/creating.cpp delete mode 100644 doc/src/snippets/sensors/main.cpp delete mode 100644 doc/src/snippets/sensors/mybackend.h delete mode 100644 doc/src/snippets/sensors/plugin.cpp delete mode 100644 doc/src/snippets/sensors/sensors.pro delete mode 100644 doc/src/snippets/sensors/start.cpp delete mode 100644 doc/src/snippets/snippets.pro delete mode 100644 examples/sensors/accel/accel.pro delete mode 100644 examples/sensors/accel/main.cpp create mode 100644 examples/sensors/accelbubble/doc/src/accelbubble.qdoc create mode 100644 examples/sensors/cubehouse/doc/src/cubehouse.qdoc create mode 100644 examples/sensors/grue/doc/src/grue.qdoc create mode 100644 examples/sensors/maze/doc/src/maze.qdoc create mode 100644 examples/sensors/qmlqtsensors/doc/src/qmlqtsensors.qdoc create mode 100644 examples/sensors/qmlsensorgestures/doc/src/qmlsensorgtestures.qdoc create mode 100644 examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc create mode 100644 examples/sensors/sensorgestures/doc/images/sensorgesturecpp.png create mode 100644 examples/sensors/sensorgestures/doc/src/sensorgestures.qdoc create mode 100644 examples/sensors/shakeit/doc/images/shakeit.png create mode 100644 examples/sensors/shakeit/doc/src/shakeit.qdoc create mode 100644 src/sensors/doc/images/XAngle.gif create mode 100644 src/sensors/doc/images/XAngleNegative.gif create mode 100644 src/sensors/doc/images/YAngle.gif create mode 100644 src/sensors/doc/images/YAngleNegative.gif create mode 100644 src/sensors/doc/images/cubehouse.png create mode 100644 src/sensors/doc/images/maze.png create mode 100644 src/sensors/doc/images/qmlqtsensors.png create mode 100644 src/sensors/doc/images/sensorgesture-cover.png create mode 100644 src/sensors/doc/images/sensorgesture-doubletap.png create mode 100644 src/sensors/doc/images/sensorgesture-facedown.png create mode 100644 src/sensors/doc/images/sensorgesture-faceup.png create mode 100644 src/sensors/doc/images/sensorgesture-flat.png create mode 100644 src/sensors/doc/images/sensorgesture-hover.png create mode 100644 src/sensors/doc/images/sensorgesture-shake.png create mode 100644 src/sensors/doc/images/sensorgesture-slam_1.png create mode 100644 src/sensors/doc/images/sensorgesture-slam_2.png create mode 100644 src/sensors/doc/images/sensorgesture-twist.png create mode 100644 src/sensors/doc/images/sensorgesture-whip.png create mode 100644 src/sensors/doc/images/sensors-coordinates.jpg create mode 100644 src/sensors/doc/images/sensors-coordinates2.jpg create mode 100644 src/sensors/doc/images/sensors-coordinates3.jpg create mode 100644 src/sensors/doc/images/sensors-dynamic.png create mode 100644 src/sensors/doc/images/sensors-geo-vs-raw-magnetism.jpg create mode 100644 src/sensors/doc/images/sensors-orientation.jpg create mode 100644 src/sensors/doc/images/sensors-overview.png create mode 100644 src/sensors/doc/images/sensors-rotation-anim.gif create mode 100644 src/sensors/doc/images/sensors-rotation.jpg create mode 100644 src/sensors/doc/images/sensors-rotation2.jpg create mode 100644 src/sensors/doc/images/sensors-rotation3.jpg create mode 100644 src/sensors/doc/images/sensors-sides.jpg create mode 100644 src/sensors/doc/images/sensors-sides2.jpg create mode 100644 src/sensors/doc/images/sensors-static.png create mode 100644 src/sensors/doc/qtsensors.qdocconf create mode 100644 src/sensors/doc/snippets/sensorgestures/creating.cpp create mode 100644 src/sensors/doc/snippets/sensorgestures/main.cpp create mode 100644 src/sensors/doc/snippets/sensorgestures/myplugin.h create mode 100644 src/sensors/doc/snippets/sensorgestures/plugin.cpp create mode 100644 src/sensors/doc/snippets/sensorgestures/sensorgestures.pro create mode 100644 src/sensors/doc/snippets/sensors/creating.cpp create mode 100644 src/sensors/doc/snippets/sensors/main.cpp create mode 100644 src/sensors/doc/snippets/sensors/mybackend.h create mode 100644 src/sensors/doc/snippets/sensors/plugin.cpp create mode 100644 src/sensors/doc/snippets/sensors/sensors.pro create mode 100644 src/sensors/doc/snippets/sensors/start.cpp create mode 100644 src/sensors/doc/snippets/snippets.pro create mode 100644 src/sensors/doc/src/compatmap.qdoc create mode 100644 src/sensors/doc/src/genericbackend.qdoc create mode 100644 src/sensors/doc/src/porting.qdoc create mode 100644 src/sensors/doc/src/qtmobilitysensors1.qdoc create mode 100644 src/sensors/doc/src/qtsensorgestures-cpp.qdoc create mode 100644 src/sensors/doc/src/qtsensorgestures-emulator.qdoc create mode 100644 src/sensors/doc/src/qtsensorgestures-plugins.qdoc create mode 100644 src/sensors/doc/src/qtsensors-backend.qdoc create mode 100644 src/sensors/doc/src/qtsensors-cpp.qdoc create mode 100644 src/sensors/doc/src/qtsensors.qdoc create mode 100644 src/sensors/doc/src/qtsensors5.qdoc create mode 100644 src/sensors/doc/src/sensor-examples.qdoc diff --git a/doc/src/compatmap.qdoc b/doc/src/compatmap.qdoc deleted file mode 100644 index 0fd4951..0000000 --- a/doc/src/compatmap.qdoc +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page compatmap.html - \title Compatibility Map - \brief Overview of supported sensors for each platform - - \raw HTML - - - - - - - - - - - - - - - - -
ColorExplanation
The feature is fully supported.
The feature is not supported.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureBlackberryLinuxGeneric
Accelerometer
Ambient Light Sensor
Compass
Gyroscope
IR Proximity Sensor
Light Sensor
Magnetometer
Orientation Sensor
Proximity Sensor
Rotation Sensor
Tap Sensor
Sensor Gestures1)
- - \endraw - - 1) Support depends on the underlying platform - - In addition to the table above, each sensor type might support specific features. For example - a magnetometer might support returning geo values. See QSensor::isFeatureSupported() for - additional details. -*/ - diff --git a/doc/src/examples/accelbubble.qdoc b/doc/src/examples/accelbubble.qdoc deleted file mode 100644 index 9199b17..0000000 --- a/doc/src/examples/accelbubble.qdoc +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/accelbubble - \title Qt Sensors - Accel Bubble - \brief The AccelBubble example demonstrates the Legacy Accelerometer QML type. - \ingroup qtsensors-examples - -\section1 Overview - Writing a QML application that uses the Legacy Accelerometer QML sensors type requires the following steps: - - Import the Legacy Sensors Declarative module. - -\snippet ../examples/sensors/accelbubble/accelbubble.qml 0 - - Add an Accelerometer QML type. - -\snippet ../examples/sensors/accelbubble/accelbubble.qml 1 - - Use the 'active' property to start the sensor - -\snippet ../examples/sensors/accelbubble/accelbubble.qml 2 - - Move the bubble according to a factor of the accelerator sensor - -\snippet ../examples/sensors/accelbubble/accelbubble.qml 3 - -*/ - diff --git a/doc/src/examples/cubehouse.qdoc b/doc/src/examples/cubehouse.qdoc deleted file mode 100644 index 37d5fe2..0000000 --- a/doc/src/examples/cubehouse.qdoc +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/cubehouse - \title Qt Sensors - 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. - \image cubehouse.png - -\section1 Overview - To write a QML application that will use the QML Accelerometer type from the QtSensors import you need to to the following steps: - - Import the QtSensors declarative plugin: - -\snippet ../examples/sensors/cubehouse/cubehouse.qml 0 - - Add the Accelerometer QML types into your qml file. - -\snippet ../examples/sensors/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 - - Reading out the Accelerometer data can be done by implementing the 'onReadingChanged' slot and - accessing the 'reading' property from the Accelerometer type: - -\snippet ../examples/sensors/cubehouse/cubehouse.qml 3 - - By using a timer the view can be rotated using the pitch and roll properties from the Accelerometer type: - -\snippet ../examples/sensors/cubehouse/cubehouse.qml 4 - -*/ - diff --git a/doc/src/examples/grue.qdoc b/doc/src/examples/grue.qdoc deleted file mode 100644 index 1eed941..0000000 --- a/doc/src/examples/grue.qdoc +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page gruesensorexample.html - \title Qt Sensors - Grue Sensor Example - \brief The Qt Sensors - Grue sensor example demonstrates all the steps from creating a new sensor to using it. - \ingroup qtsensors-examples - - The Qt Sensors - Grue sensor example demonstrates all the steps from creating a new sensor to using it. - - The sensor definition is placed in a library where client apps can access it. The actual implementation - lives in a plugin. - - \list - \li \l{Grue Sensor Definition} - \li \l{Grue Sensor Implementation} - \endlist - - The sensor can now be used by a C++ application, even if the application does not have access to the - definition. - - \list - \li \l{Grue Sensor Console Application} - \endlist - - To make the sensor available to a QML application an import must be created. - - \list - \li \l{Grue Sensor QML Import} - \li \l{Grue Sensor QML Application} - \endlist -*/ - -/*! - \example sensors/grue/lib - \title Grue Sensor Definition - \brief The Grue sensor is defined in a library so that applications can use it. - - First up is the sensor type. This is the interface for sensors that report - on your likelihood of being eaten by a Grue. Such sensors are very important - to adventurers, particularly if they are going into dark places as this is - where Grues live. - - The interface is a simple one. It provides only 1 piece of information, your - chance of being eaten. For the details on how this is property should be - interpreted please see the documentation in gruesensor.cpp. - - This example was created using the make_sensor.pl script which can be found in - src/sensors. As such, it contains some generated code that defines the convenience - classes GrueFilter and GrueSensor. - - \sa {Qt Sensors - Grue Sensor Example} -*/ - -/*! - \example sensors/grue/plugin - \title Grue Sensor Implementation - \brief The Grue sensor implementation lives in a plugin that is loaded by the Qt Sensors library. - - The Grue sensor needs a backend before it can be used. The backend provided - is rather basic and it relies on some kind of light sensor to work but it - gets the job done. If new hardware that can detect the actual presence of Grues - becomes available a backend could be created that supports this hardware and - applications using the Grue sensor would be able to use it without any changes. - - There are a few mandatory parts to a backend. They are the start and stop methods - and the setReading call. The start and stop methods are used to start and stop - any underlying hardware. In the case of this backend they start and stop a - 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 - - 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 - - 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. - - \code - // Create a reading instance for us to use - m_reading = setReading(0); - \endcode - - The Grue sensor backend also supplies some metadata. - - The backend checks 2 things, how dark it is and how long you have been in the dark. - It uses the readingChanged() signal to know when to check the light sensor's - value. Once it is dark, it uses a timer to increase your chance of being eaten. - - The Grue sensor backend is delivered as a plugin. The plugin has a factory object - that registers the types available and does the actual instantiation of the backend. - - \sa {Qt Sensors - Grue Sensor Example} -*/ - -/*! - \example sensors/grue/console_app - \title Grue Sensor Console Application - \brief The Grue sensor console application demonstrates use of the Grue sensor. - - This is a simple commandline application. It demonstrates how to use the generic - access feature of Qt Sensors to avoid a link-time dependency on the Grue Sensor - library. - - \sa {Qt Sensors - Grue Sensor Example} -*/ - -/*! - \example sensors/grue/import - \title Grue Sensor QML Import - \brief The Grue sensor QML import exports the GrueSensor class as a QML type. - - This example creates the \e {Grue 1.0} import. - - \sa {Qt Sensors - Grue Sensor Example} -*/ - -/*! - \example sensors/grue - \title Grue Sensor QML Application - \brief The Grue sensor QML application demonstrates use of the GrueSensor QML type. - - This is a pure QML application that can be run from Qt Creator or directly using the - \c qmlscene binary. You should install the other projects before trying to run - this example or it will not be able to find its dependencies. - - \code - qmlscene grue.qml - \endcode - - \sa {Qt Sensors - Grue Sensor Example} -*/ - diff --git a/doc/src/examples/maze.qdoc b/doc/src/examples/maze.qdoc deleted file mode 100644 index e180728..0000000 --- a/doc/src/examples/maze.qdoc +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/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 type. - - - To write a QML application that will use the TiltSensor QML sensors type you need to do the following steps: - - Import the QtSensors 5.x declarative plugin: - - \snippet ../examples/sensors/maze/maze.qml 0 - - Add the Sensor QML types 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 - - Starting the sensor can be done by setting the 'enabled' property to true: - - \snippet ../examples/sensors/maze/maze.qml 2 - - The mouse should move by a factor of the tilt value: - - \snippet ../examples/sensors/maze/maze.qml 3 - - The walk direction of the mouse takes into account some collision detection: - - \snippet ../examples/sensors/maze/maze.qml 4 - - The rotation of the mouse image is determined according to the angle that the mouse is moving. - - \snippet ../examples/sensors/maze/Mouse.qml 0 - -*/ - diff --git a/doc/src/examples/qmlqtsensors.qdoc b/doc/src/examples/qmlqtsensors.qdoc deleted file mode 100644 index ed6c99f..0000000 --- a/doc/src/examples/qmlqtsensors.qdoc +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/qmlqtsensors - \title Qt Sensors - QML example - \ingroup qtsensors-examples - \image qmlqtsensors.png - - \section2 Qt Sensors in QML - \brief The QtSensors - QML example demonstrates the QML sensors types in the QtSensors 5 import. - - - To write a QML application that will use the QML sensors types in the QtSensors 5 import you need to to the following steps: - - Import the QtSensors 5.x declarative plugin: - - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 0 - - Add the Sensor QML types into your qml file. - - In this example we use the TiltSensor: - - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 1 - - The Tilt-, AmbientLight- and the Proximity QML sensor types have the 'enabled' property in common. - To start or stop the sensor set this property to true or false. - - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 2 - - Reading the data can be done for each sensor type like following: - - \l {QtSensors::TiltSensor} {TiltSensor} - - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 3 - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 4 - - \l {QtSensors::AmbientLightSensor} {AmbientLightSensor} - - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 5 - - \l {QtSensors::ProximitySensor} {ProximitySensor} - - \snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 6 -*/ - diff --git a/doc/src/examples/qmlsensorgtestures.qdoc b/doc/src/examples/qmlsensorgtestures.qdoc deleted file mode 100644 index 74e65ae..0000000 --- a/doc/src/examples/qmlsensorgtestures.qdoc +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/qmlsensorgestures - \title Qt Sensors - SensorGesture QML Type example - \ingroup qtsensors-examples - - \brief This example demonstrates use of the SensorGesture QML type. - -\section1 Overview - To write a QML application that will use the gesture plugin you need to to the following steps: - - Import the QtSensors 5.x declarative plugin: - -\snippet ../examples/sensors/qmlsensorgestures/GestureView.qml 0 - - Add the SensorGesture QML type into your qml file. - -\snippet ../examples/sensors/qmlsensorgestures/GestureView.qml 1 - - Each SensorGesture QML type contains a property called gestures. - - In this example an alias 'gestureid' for this property is used. - -\snippet ../examples/sensors/qmlsensorgestures/GestureView.qml 2 - - By using this alias property you define which gestures should be used: - -\snippet ../examples/sensors/qmlsensorgestures/qmlsensorgestures.qml 3 - - A list of all available gestures can be created by calling the 'availableGestures' property: - -\snippet ../examples/sensors/qmlsensorgestures/GestureList.qml 4 - -\sa {Qt Sensors - ShakeIt QML Example} -\sa {Qt Sensor Gestures} -*/ - diff --git a/doc/src/examples/sensor_explorer.qdoc b/doc/src/examples/sensor_explorer.qdoc deleted file mode 100644 index 92879c2..0000000 --- a/doc/src/examples/sensor_explorer.qdoc +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/sensor_explorer - \title Qt Sensors - Explorer QML example - \ingroup qtsensors-examples - - \section2 Sensor Explorer in QML - \brief The Sensor Explorer example demonstrates how to read the meta-data of available sensors. - - - This example is divided into two parts: - - \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 - - - This is a pure QML application that can be run from Qt Creator or directly using the - \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 - - To write a QML application that will use the Explorer QML type you need to do the following steps: - - Import the Explorer 1.0 declarative plugin: - - \snippet ../examples/sensors/sensor_explorer/sensor_explorer.qml 0 - - Create a SensorExplorer QML item: - - \snippet ../examples/sensors/sensor_explorer/sensor_explorer.qml 1 - - You can retrieve a list of all available sensors using the SensorExplorer: - - \snippet ../examples/sensors/sensor_explorer/sensor_explorer.qml 2 - - To retrieve the properties of a SensorItem use: - - \snippet ../examples/sensors/sensor_explorer/sensor_explorer.qml 3 - - Changing a property value can be done like: - - \snippet ../examples/sensors/sensor_explorer/sensor_explorer.qml 4 - - Starting and stopping a sensor can be done like: - - \snippet ../examples/sensors/sensor_explorer/sensor_explorer.qml 5 -*/ - -/*! - \example sensors/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 type. - - 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 deleted file mode 100644 index d34f383..0000000 --- a/doc/src/examples/sensorgestures.qdoc +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page sensorgestureexample.html - \title Qt Sensors - 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 &) } - - As well, Sensor Gesture Recognizers may implement any number of their own custom signals. - - Our shake recognizer defines one custom signal, \c {void shake()}, as well as the predefined - detected signal. - - \section1 SensorGestures Class Implementation - - 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 - - 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 - - and later stop the detection process. - - \snippet ../examples/sensors/sensorgestures/mainwindow.cpp 2 - - The QSensorGesture object will contain all the signals of the valid requested recognizers found on the system. - - You can discover which of the requested recognizer ID's that were not found by using QSensorGesture::invalidIds(); - - By using QSensorGesture::gestureSignals(), you can get a QStringList of usable signals. - - -*/ diff --git a/doc/src/examples/sensors.qdoc b/doc/src/examples/sensors.qdoc deleted file mode 100644 index d934c8a..0000000 --- a/doc/src/examples/sensors.qdoc +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \group qtsensors-examples - \title Qt Sensors Examples - \brief Examples for the Qt Sensors module - \ingroup all-examples - - These are the Qt Sensors examples. - - \generatelist related -*/ - - - diff --git a/doc/src/examples/shakeit.qdoc b/doc/src/examples/shakeit.qdoc deleted file mode 100644 index 1dc300f..0000000 --- a/doc/src/examples/shakeit.qdoc +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example sensors/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. - - Writing a QML application that uses the Shake QML sensorgestures type requires the following steps: - - Import the Sensors Declarative module. - - \snippet ../examples/sensors/shakeit/shakeit.qml 0 - - Add a SensorGesture QML type. - - \snippet ../examples/sensors/shakeit/shakeit.qml 1 - - In the SensorGesture type, 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/sensors/shakeit/shakeit.qml 2 - - Use the 'enabled' property to start the sensor gesture. - - \snippet ../examples/sensors/shakeit/shakeit.qml 3 - - Use the onDetected signal to do stuff. - - \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/doc/src/genericbackend.qdoc b/doc/src/genericbackend.qdoc deleted file mode 100644 index 689b412..0000000 --- a/doc/src/genericbackend.qdoc +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page genericbackend.html - \title Generic Backend - \brief Information about the generic sensor backend - - The generic sensor backend provides emulation of some of the sensors that are not supported on the - platform. - For example, on a platform without a rotation sensor but with an accelerometer, the accelerometer - is used to calculate the rotation, thus providing an emulated rotation sensor. - - The following generic sensors are supported: - \table - \header - \li Emulated Sensor - \li Source Sensor - \row - \li Ambient Light Sensor - \li Light Sensor - \row - \li Orientation Sensor - \li Accelerometer - \row - \li Rotation Sensor - \li Accelerometer - \endtable - If a platform doesn't support the source sensor, then the sensor can not be emulated. -*/ - diff --git a/doc/src/images/XAngle.gif b/doc/src/images/XAngle.gif deleted file mode 100644 index 045f235..0000000 Binary files a/doc/src/images/XAngle.gif and /dev/null differ diff --git a/doc/src/images/XAngleNegative.gif b/doc/src/images/XAngleNegative.gif deleted file mode 100644 index 92fc923..0000000 Binary files a/doc/src/images/XAngleNegative.gif and /dev/null differ diff --git a/doc/src/images/YAngle.gif b/doc/src/images/YAngle.gif deleted file mode 100644 index 004fdd1..0000000 Binary files a/doc/src/images/YAngle.gif and /dev/null differ diff --git a/doc/src/images/YAngleNegative.gif b/doc/src/images/YAngleNegative.gif deleted file mode 100644 index 1dce653..0000000 Binary files a/doc/src/images/YAngleNegative.gif and /dev/null differ diff --git a/doc/src/images/cubehouse.png b/doc/src/images/cubehouse.png deleted file mode 100644 index e3ff7fa..0000000 Binary files a/doc/src/images/cubehouse.png and /dev/null differ diff --git a/doc/src/images/maze.png b/doc/src/images/maze.png deleted file mode 100644 index f3ad8de..0000000 Binary files a/doc/src/images/maze.png and /dev/null differ diff --git a/doc/src/images/qmlqtsensors.png b/doc/src/images/qmlqtsensors.png deleted file mode 100644 index 0a54b65..0000000 Binary files a/doc/src/images/qmlqtsensors.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-cover.png b/doc/src/images/sensorgesture-cover.png deleted file mode 100644 index 7b4fbc5..0000000 Binary files a/doc/src/images/sensorgesture-cover.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-doubletap.png b/doc/src/images/sensorgesture-doubletap.png deleted file mode 100644 index 6253d0f..0000000 Binary files a/doc/src/images/sensorgesture-doubletap.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-facedown.png b/doc/src/images/sensorgesture-facedown.png deleted file mode 100644 index a85664f..0000000 Binary files a/doc/src/images/sensorgesture-facedown.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-faceup.png b/doc/src/images/sensorgesture-faceup.png deleted file mode 100644 index c20ef08..0000000 Binary files a/doc/src/images/sensorgesture-faceup.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-flat.png b/doc/src/images/sensorgesture-flat.png deleted file mode 100644 index e8eafaf..0000000 Binary files a/doc/src/images/sensorgesture-flat.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-hover.png b/doc/src/images/sensorgesture-hover.png deleted file mode 100644 index fecf6b3..0000000 Binary files a/doc/src/images/sensorgesture-hover.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-shake.png b/doc/src/images/sensorgesture-shake.png deleted file mode 100644 index 06f9eea..0000000 Binary files a/doc/src/images/sensorgesture-shake.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-slam_1.png b/doc/src/images/sensorgesture-slam_1.png deleted file mode 100644 index d56f889..0000000 Binary files a/doc/src/images/sensorgesture-slam_1.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-slam_2.png b/doc/src/images/sensorgesture-slam_2.png deleted file mode 100644 index 5fe8ecb..0000000 Binary files a/doc/src/images/sensorgesture-slam_2.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-twist.png b/doc/src/images/sensorgesture-twist.png deleted file mode 100644 index bec1585..0000000 Binary files a/doc/src/images/sensorgesture-twist.png and /dev/null differ diff --git a/doc/src/images/sensorgesture-whip.png b/doc/src/images/sensorgesture-whip.png deleted file mode 100644 index aa998bb..0000000 Binary files a/doc/src/images/sensorgesture-whip.png and /dev/null differ diff --git a/doc/src/images/sensorgesturecpp.png b/doc/src/images/sensorgesturecpp.png deleted file mode 100644 index 4d453cf..0000000 Binary files a/doc/src/images/sensorgesturecpp.png and /dev/null differ diff --git a/doc/src/images/sensors-coordinates.jpg b/doc/src/images/sensors-coordinates.jpg deleted file mode 100644 index e2e9890..0000000 Binary files a/doc/src/images/sensors-coordinates.jpg and /dev/null differ diff --git a/doc/src/images/sensors-coordinates2.jpg b/doc/src/images/sensors-coordinates2.jpg deleted file mode 100644 index 8dd43a2..0000000 Binary files a/doc/src/images/sensors-coordinates2.jpg and /dev/null differ diff --git a/doc/src/images/sensors-coordinates3.jpg b/doc/src/images/sensors-coordinates3.jpg deleted file mode 100644 index 0263400..0000000 Binary files a/doc/src/images/sensors-coordinates3.jpg and /dev/null differ diff --git a/doc/src/images/sensors-dynamic.png b/doc/src/images/sensors-dynamic.png deleted file mode 100644 index d2ba937..0000000 Binary files a/doc/src/images/sensors-dynamic.png and /dev/null differ diff --git a/doc/src/images/sensors-geo-vs-raw-magnetism.jpg b/doc/src/images/sensors-geo-vs-raw-magnetism.jpg deleted file mode 100644 index 272fa31..0000000 Binary files a/doc/src/images/sensors-geo-vs-raw-magnetism.jpg and /dev/null differ diff --git a/doc/src/images/sensors-orientation.jpg b/doc/src/images/sensors-orientation.jpg deleted file mode 100644 index 245533d..0000000 Binary files a/doc/src/images/sensors-orientation.jpg and /dev/null differ diff --git a/doc/src/images/sensors-overview.png b/doc/src/images/sensors-overview.png deleted file mode 100644 index 29e9ebd..0000000 Binary files a/doc/src/images/sensors-overview.png and /dev/null differ diff --git a/doc/src/images/sensors-rotation-anim.gif b/doc/src/images/sensors-rotation-anim.gif deleted file mode 100644 index 22c678d..0000000 Binary files a/doc/src/images/sensors-rotation-anim.gif and /dev/null differ diff --git a/doc/src/images/sensors-rotation.jpg b/doc/src/images/sensors-rotation.jpg deleted file mode 100644 index 1bd1b14..0000000 Binary files a/doc/src/images/sensors-rotation.jpg and /dev/null differ diff --git a/doc/src/images/sensors-rotation2.jpg b/doc/src/images/sensors-rotation2.jpg deleted file mode 100644 index 1bf34fe..0000000 Binary files a/doc/src/images/sensors-rotation2.jpg and /dev/null differ diff --git a/doc/src/images/sensors-rotation3.jpg b/doc/src/images/sensors-rotation3.jpg deleted file mode 100644 index d69a3e1..0000000 Binary files a/doc/src/images/sensors-rotation3.jpg and /dev/null differ diff --git a/doc/src/images/sensors-sides.jpg b/doc/src/images/sensors-sides.jpg deleted file mode 100644 index 8e84224..0000000 Binary files a/doc/src/images/sensors-sides.jpg and /dev/null differ diff --git a/doc/src/images/sensors-sides2.jpg b/doc/src/images/sensors-sides2.jpg deleted file mode 100644 index db66a9b..0000000 Binary files a/doc/src/images/sensors-sides2.jpg and /dev/null differ diff --git a/doc/src/images/sensors-static.png b/doc/src/images/sensors-static.png deleted file mode 100644 index 657aaad..0000000 Binary files a/doc/src/images/sensors-static.png and /dev/null differ diff --git a/doc/src/images/shakeit.png b/doc/src/images/shakeit.png deleted file mode 100644 index 5ca1b58..0000000 Binary files a/doc/src/images/shakeit.png and /dev/null differ diff --git a/doc/src/imports/qtsensors5.qdoc b/doc/src/imports/qtsensors5.qdoc deleted file mode 100644 index 02b5360..0000000 --- a/doc/src/imports/qtsensors5.qdoc +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \qmlmodule QtSensors 5.0 - \title Qt Sensors QML API - \brief QML import for QtSensors - - \section1 Overview - - This is the QtSensors QML import. - - \section1 QML Module API - - If the module is imported into a namespace, some additional methods become available. - - \code - import QtSensors 5.0 as Sensors - ... - Component.onCompleted: { - var types = Sensors.sensorTypes(); - console.log(types.join(", ")); - } - \endcode - - The documentation for the module API can be found in SensorGlobal. - - \section1 QML Sensor types - - These types represent specific types of sensors. - - Note that most properties come from the abstract \l{QtSensors::Sensor}{Sensor} element. - - \annotatedlist qml-sensors_type - - \section1 QML Reading types - - The data from a sensor comes through a reading class. - - \annotatedlist qml-sensors_reading - - \section1 Alphabetical Listing of QML Types - -*/ - diff --git a/doc/src/porting.qdoc b/doc/src/porting.qdoc deleted file mode 100644 index 24e0d7e..0000000 --- a/doc/src/porting.qdoc +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtsensors-porting.html - \title Porting Applications from QtMobility Sensors to Qt Sensors - - \tableofcontents - - \section1 Overview - - The initial release of Qt Sensors (5.0) is generally expected to be source - compatible with QtMobility Sensors 1.2. This document attempts to explain - where things must be changed in order to port applications to Qt Sensors. - - \section1 QML - - QtSensors ships with a QML import that is compatible with the QtMobility.sensors import. - The limitations of the QtMobility.sensors import have been fixed and some new properties - may exist so apps may need to be updated if they are using custom properties on their - sensor objects. - - See \l {Qt Sensors QML API} for more information. - - \section1 C++ - - \section2 Includes - - QtMobility Sensors installed headers into a \c Qt Sensors directory. This is - also the directory that Qt Sensors uses. It is therefore expected that includes - that worked with QtMobility Sensors should continue to work. - - For example: - \code - #include - #include - #include - #include - \endcode - - \section2 Macros and Namespace - - QtMobility Sensors was built in a \c QtMobility namespace. This was enabled by - the use of various macros. Qt Sensors does not normally build into a namespace - and the macros from QtMobility no longer exist. - - \list - \li QTM_BEGIN_NAMESPACE - \li QTM_END_NAMESPACE - \li QTM_USE_NAMESPACE - \li QTM_PREPEND_NAMESPACE(x) - \endlist - - Note that Qt can be configured to build into a namespace. If Qt is built in this - way then Qt Sensors is also built into the nominated namespace. However, as this - is optional, the macros for this are typically defined to do nothing. - - \list - \li QT_BEGIN_NAMESPACE - \li QT_END_NAMESPACE - \li QT_USE_NAMESPACE - \li QT_PREPEND_NAMESPACE(x) - \endlist - - \section2 qtimestamp - - qtimestamp was previously defined as an opaque type equivalent to a quint64. It existed - as a class due to an implementation detail. - - In Qt Sensors, the API uses quint64 instead of qtimestamp. qtimestamp still exists as a - typedef so that applications that refer to qtimestamp can be compiled. - - \section1 Project Files - - QtMobility Sensors applications used this in their project files to enable the Sensors API. - - \code - CONFIG += mobility - MOBILITY += sensors - \endcode - - Applications should remove these lines and instead use this to enable the Qt Sensors API. - - \code - QT += sensors - \endcode -*/ - diff --git a/doc/src/qtsensorgestures-cpp.qdoc b/doc/src/qtsensorgestures-cpp.qdoc deleted file mode 100644 index 179fc70..0000000 --- a/doc/src/qtsensorgestures-cpp.qdoc +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\page qtsensorgestures-cpp.html -\title QtSensorGestures C++ API -\brief Information about the QtSensorGestures C++ API - -\tableofcontents - -\section1 - - -\section1 Using QtSensorGestures - -With QtSensorGestures, you are able to easily utilize device gesturing using -sensors such as the accelerometer and proximity. - -A list of currently supported sensor gestures and their descriptions can be found here: -\l {Qt Sensor Gestures} - -Using QtSensorGestures is easy. There are two main classes you will need to use. - -QSensorGestureManager can be used for determining what sensor gestures are available, and -QSensorGesture for connecting the sensor gesture signals. - -\snippet snippets/sensorgestures/creating.cpp Receiving sensor gesture signals - -More information about the sensor gesture recognizers can be found in -\l{QtSensorGestures Plugins}. - -\section1 Main Classes - -The primary classes that make up the QtSensorGestures API. - -\annotatedlist sensorgestures_main - - -*/ - diff --git a/doc/src/qtsensorgestures-emulator.qdoc b/doc/src/qtsensorgestures-emulator.qdoc deleted file mode 100644 index af061e2..0000000 --- a/doc/src/qtsensorgestures-emulator.qdoc +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $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. - -\section1 Developing sensor gesture clients. - -For instance, the Emulator can be used for writing a client app that needs -to use the 'slam' gesture. - -Under the 'Sensors' heading in the Emulator control, you will see an edit -box for 'Sensor gestures' that will contain a list of signals available -when your client instantiates a QSensorGesture. - -Select 'slam', and then click the 'Send' button -to send a detected("slam") signal to the client. - -*/ diff --git a/doc/src/qtsensorgestures-plugins.qdoc b/doc/src/qtsensorgestures-plugins.qdoc deleted file mode 100644 index a9996ca..0000000 --- a/doc/src/qtsensorgestures-plugins.qdoc +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\group sensorgesture_plugins_topics -\title QtSensorGestures Plugins -\brief Information about the QtSensorGestures recognizer plugins. - -The QtSensorGestures recognizer plugins are the way to create your own -sensor gestures. - -Creating software to recognize motion gestures using sensors is a huge subject not covered here. - -The QSensorGesture API does not limit usage to any of the common classification methods of gesture -recognition such as Hidden Markov Models, Neural Networks, Dynamic Time Warping, or even the -ad-hoc heuristic recognizers of Qt's built-in sensor gesture recognizers. It's basically a -signaling system for lower level gesture recogition methods and algorithms to communicate to the -higher level applications. - -\tableofcontents - -\section1 Overview - - The steps to creating a sensor gesture plugin are as follows: -\list -\li Sub-class from QSensorGesturePluginInterface -\li Sub-class from QSensorGestureRecognizer and implement gesture recognizer logic using QtSensors. -\li Create an instance of that recognizer in the derived QSensorGesturePluginInterface class, and call - QSensorGestureManager::registerSensorGestureRecognizer(sRec); in your registerRecognizers() -function. QSensorGestureManager will retain ownership of the recognizer object. - -This is the class in which the gesture recognizer system should be implemented from. - -\endlist - -\snippet snippets/sensorgestures/plugin.cpp Plugin - - -\section2 Recognizer Classes - -If you are making sensorgestures available through the QtSensorGestures API, these are the -classes to subclass. - -\annotatedlist sensorgestures_recognizer - -\target Qt Sensor Gestures -\section3 Recognizer Plugins - -The Sensor Gesture Recognizers that come with Qt are made using an ad-hock heurustic approach. -The user cannot define their own gestures, and must learn how to perform and accomodate the -pre-defined gestures herein. - -A developer may use any method including computationally and training intensive well - known classifiers, to produce gesture recognizers. There are currently no classes in Qt for -gesture training, nor ability for the user to define their own sensor based motion gestures. - -A procedure for writing ad-hock recognizers might include: -\list - \li Obtain and gather output from the accelerometer through QAccelerometerReading of a gesture being performed. - \li Use various methods and constraints on the accelerometer data to recognize the various states: - \list i - \li Initial 'listening' state for a gesture - \li Start of a possible gesture, moving into a 'detecting' state - \li End of a possible gesture, moving into a 'recognizing' state - \li and finally, if it is recognized, the 'recognized' state, or if not recognized, move back to - the 'listening' state. - \endlist - \li Test procedure to make sure it is easy to perform, and will not - produce too many false positive recognitions. And if used with other gestures, collisions. Meaning -that gestures performed get recognized as another gesture instead. - -\endlist - -Here is a list of included plugins and their signals - -For ShakeGestures plugin: - \table - \row - \li Recognizer Id - \li Signals - \row - \li QtSensors.shake - \li shake -\endtable - -For QtSensorGestures plugin: - \table - \row - \li Recognizer Id - \li Signals - \li Description - \li Images - \row - \li QtSensors.cover - \li cover - \li Hand covers up phone display for one second, when it's face up, using the Proximity and Orientation sensors. - \li \image sensorgesture-cover.png - \row - \li QtSensors.doubletap - \li doubletap - \li Double tap of finger on phone, using the DoubleTap sensor. - \li \image sensorgesture-doubletap.png - \row - \li QtSensors.hover - \li hover - \li Hand hovers about 4 cm above the phone for more than 1 second, then is removed when face up, - using the IR Proximity sensor. - \li \image sensorgesture-hover.png - \row - \li QtSensors.pickup - \li pickup - \li Phone is resting face up on a flat curface, and is then picked up and brought up into viewing position, using the Accelerometer sensor. - \li \image sensorgesture-faceup.png - \row - \li QtSensors.shake2 - \li shakeLeft, shakeRight, shakeUp, shakeDown - \li Shake phone in a certain direction, using the Accelerometer sensor. - \li \image sensorgesture-shake.png - \row - \li QtSensors.slam - \li slam - \li Phone is held in a top up position with a side facing forward for a moment. Swing it quickly with a downward motion - like it is being used to point at something with the top corner. using the Accelerometer and Orientation sensors. - \li \image sensorgesture-slam_1.png - \image sensorgesture-slam_2.png - \row - \li QtSensors.turnover - \li turnover - \li Phone is turned face down and placed on a surface, using Proximity and Orientation sensors. - \li \image sensorgesture-facedown.png - \row - \li QtSensors.twist - \li twistLeft, twistRight - \li Phone is held face up and then twisted left or right (left side up or right side up) and back, using the Accelerometer and Orientation sensors. - \li \image sensorgesture-twist.png - \row - \li QtSensors.whip - \li whip - \li Move phone quickly down and then back up. using the Accelerometer and Orientation sensors. - \li \image sensorgesture-whip.png - \endtable - -*/ diff --git a/doc/src/qtsensors-backend.qdoc b/doc/src/qtsensors-backend.qdoc deleted file mode 100644 index d3c6e75..0000000 --- a/doc/src/qtsensors-backend.qdoc +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\group sensors_backend_topics -\title Qt Sensors Backend -\brief Information about the Qt Sensors back end - -The Qt Sensors backend connects the Qt Sensors API to the platform services or hardware sensors. - -\tableofcontents - -\section1 Overview - -\section1 Backend API - -QSensor instances talk to a backend object. Backends are usually supplied -with the Qt Sensors library for a specific device although third party -backends may be used as well. A backend may talk -directly to hardware or it may talk to a system service. In some instances -it may even talk to another sensor. -An example of this is the orientation sensor backend that talks to an -accelerometer to determine the device orientation. - -\section1 Backend Classes -If you are making sensors available through the Sensors API, these are the -classes to use. -\annotatedlist sensors_backend - -\section1 Backend Topics - -\generatelist related - -*/ - -/*! -\page creating-a-sensor-plugin.html -\title Creating a sensor plugin -\ingroup sensors_backend_topics - -\section1 How a sensor plugin is loaded - -Since sensor backends are created on demand, the sensor plugin is loaded and asked -to register the sensor backends it handles. The plugin should implement -QSensorPluginInterface::registerSensors() and call QSensorManager::registerBackend() -to register available backends. Typically the plugin will also inherit from -QSensorBackendFactory and implement -QSensorBackendFactory::createBackend() in order to instantiate backends it has registered. - -The simplest plugin will have just once sensor backend although there is no reason -that multiple sensor backends cannot be in a plugin. - -An example follows. - -\snippet snippets/sensors/plugin.cpp Plugin - -*/ - -/*! -\page determining-the-default-sensor-for-a-type.html -\title Determining the default sensor for a type -\ingroup sensors_backend_topics - -\section1 Multiple sensors can exist for a type - -Sensors was designed so that multiple sensors could exist for a given type. Why? -Consider this example. - -The N900 has an accelerometer built-in. It also features bluetooth and can pair -with a gaming controller that features an accelerometer. To a developer writing -a game these two devices are conceptually the same type. - -\section1 Default sensor for a type - -To avoid the need to know (or check) what the default sensor for a type is, the system will -use the default sensor for a type. Most of the time this is what the app developer wants to -do. In cases where the app developer wants to select a specific sensor they must call the -QSensor::setIdentifier() method before they start the sensor so that the appropriate backend -is used. - -From a system perspective though, selecting which sensor should be the default gets tricky. -The sensors library uses the first registered identifier as the default. This means that the -order in which sensor backends are registered is important so the system will allow a config -file to determine the default instead. - -\section1 Sensors.conf - -The config file that determines the default sensor for a type is called Sensors.conf. If present, -it is located in /etc/xdg/Nokia. It has the standard formatting of an ini file. - -The settings live in the Default group and the general format is: -\code -type = identifier -\endcode - -An example Sensors.conf that ensures the N900 accelerometer is used as the default no matter the -order in which backends were registered is presented here. - -\code -[Default] -QAccelerometer = n900.accelerometer -\endcode - -If Sensors.conf specifies an identifier that is not registered then the system will fall back to -the first registered identifier as the default. - -Note that there is special case logic to prevent the generic plugin's backends from becoming the -default when another backend is registered for the same type. This logic means that a backend -identifier starting with \c{generic.} will only be the default if no other backends have been -registered for that type or if it is specified in \c{Sensors.conf}. - -*/ - -/*! -\page dynamic-sensor-backend-registration.html -\title Dynamic Sensor Backend Registration -\ingroup sensors_backend_topics - -\section1 Static Backend Registration - -Sensor backends are generally registered statically. The registration happens when the sensors -library is first used and the registration remains in effect while the program runs. - -\image sensors-static.png - -Statically registered backends may still exhibit some dynamic behaviour as the -QSensorBackendFactory is free to return 0 to indicate that a backend cannot be created. - -\section1 Dynamic Backend Registration - -While static registration is fine for most backends there are some situations where this is -problematic. - -The clearest example is backends that represent non-fixed hardware. As an example, lets consider -a game controller that is connected via Bluetooth. As there may be more than one game controller -in range of the phone, the program wants to record that a specific game controller should be used. -If the backend had been registered statically there would have been no unique information about -the controller. Instead, the registration is delayed until the controller is seen. - -\image sensors-dynamic.png - -\section1 Suggested Registration Policy - -A backend for fixed hardware should be registered immediately. Applications can see that the -sensor can be used. - -A backend for remote hardware should not be registered immediately. Applications can see that -the sensor cannot be used. When the remote hardware becomes available the backend should be -registered. Applications can see that the sensor is now available. - -If it is necessary to return 0 from a factory for a backend that was registered, the backend -should be unregistered. Applications can see that the sensor is no longer available. If the -factory can create the backend again it should be registered. Applications can see that the -sensor is available again. - -When the underlying hardware is no longer available, the backend should be deregistered. -Existing instances of the backend should report error states to the application but should -handle the situation gracefully. - -*/ diff --git a/doc/src/qtsensors-cpp.qdoc b/doc/src/qtsensors-cpp.qdoc deleted file mode 100644 index 49bb8a5..0000000 --- a/doc/src/qtsensors-cpp.qdoc +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\page qtsensors-cpp.html -\title Qt Sensors C++ API -\brief Information about the Qt Sensors C++ API - -\tableofcontents - -\section1 Sensor Types - -On a device there can be many types of sensors. Not all of the types that the Qt Sensors API -supports may be available. There may also be types available that are not defined in the -Qt Sensors 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, Qt Sensors uses the -\l{http://en.wikipedia.org/wiki/Cartesian_coordinate_system}{Right Hand Cartesian coordinate system}. - -\image sensors-coordinates.jpg - -To allow for measurements in all 6 directions, negative values are used. - -\image sensors-coordinates2.jpg - -Where rotation around an axis is used, the rotation shall be expressed as a Right Hand rotation. - -\image sensors-coordinates3.jpg - -In general, sensor data is oriented to the top of the device. If values are to be displayed on -the screen the values may need to be transformed so that they match the user interface orientation. A sensor -may define its data as being oriented to the UI. This will be noted in the documentation for the -sensor. - -\image sensors-sides2.jpg - -\section1 Using a Sensor - -The life cycle of a QSensor is typically: - -\list -\li Create an instance of QSensor or one of its sub-classes on the stack or heap. -\li Setup as required by the application. -\li Start receiving values. -\li Sensor data is used by the application. -\li Stop receiving values. -\endlist - -Here is an example of creating a sensor on the heap and on the stack. - -\snippet snippets/sensors/creating.cpp Creating a sensor - -\section1 Accessing sensor data in a generic fashion - -The preferred way to deal with sensor data is via the \l{Reading Classes}. -However, sometimes this may not be possible. For example, you may be deploying -an application to a device that has a new sensor type but no C++ header -describing the reading class is available. - -Thanks to Qt's property system you can still access the sensor data. You need to know -3 pieces of information in order to do this: - -\list -\li The sensor type. -\li The property name or index. -\li The property type or a comparable type. -\endlist - -For example, here is an example of how you can access a property of the accelerometer. -This code does not require any compile-time links to \l QAccelerometer or -\l QAccelerometerReading. - -\snippet snippets/sensors/start.cpp Starting a sensor - -You can discover all of this information at runtime too. The sensor_explorer example -shows you information about available sensors. - -\section1 Front end, back end - -The Qt Sensors API has a front end, for application developers to use and a back end, -where device implementors write code to access their hardware. As an application -developer you do not need to access the back end though it may be useful to understand -how it works. - -Commands from the application are delivered through QSensor and then down to the -device plugin. Data comes back through the QSensorReading class. - -\image sensors-overview.png - -More information about the back end can be found in \l{Qt Sensors Backend}. - -\section1 Main Classes - -The primary classes that make up the Qt Sensors API. - -\annotatedlist sensors_main - -\section1 Reading Classes - -The best way to access sensor data is via one of these classes. - -\annotatedlist sensors_reading - -\section1 Sensor Classes - -These classes provide convenience wrappers that reduce the need for casting. -Each of these classes represents a sensor type that the Qt Sensors API knows -about. Note that additional types may be made available at run-time. See -\l{Sensor Types} for more information. - -\annotatedlist sensors_type - -\section1 Filter Classes - -As with the sensor classes, these provide convenience wrappers that reduce -the need for casting. - -\annotatedlist sensors_filter - -*/ - diff --git a/doc/src/qtsensors.qdoc b/doc/src/qtsensors.qdoc deleted file mode 100644 index b437da2..0000000 --- a/doc/src/qtsensors.qdoc +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** 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. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page index-qtsensors.html - \title Qt Sensors - \brief The Qt Sensors API provides access to sensors via QML and C++ interfaces. - \ingroup technology-apis - - The Qt Sensors API provides access to sensor hardware via QML and C++ interfaces. - - \section1 Information for Application Writers - - Applications can access Qt Sensors using QML or C++. - - \table - \row - \li \l {Qt Sensors QML API}{QML API} - \li Information about the Qt Sensors QML API - \row - \li \l {Qt Sensors C++ API}{C++ API} - \li Information about the Qt Sensors C++ API - \row - \li \l {Qt Sensors Examples}{Examples} - \li Examples demonstrating use of the Qt Sensors APIs - \endtable - - \section1 Information for Backend Implementors - - \table - \row - \li \l {Qt Sensors Backend}{Backend} - \li Information about the Qt Sensors back end - \row - \li \l {Qt Sensors - Grue Sensor Example} - \li The Qt Sensors - Grue Sensor Example demonstrates creation of a sensor backend - \endtable - - \section1 Compatibility with QtMobility Sensors API - - Qt Sensors 5.0 (the initial release) is generally expected to be source compatible - with QtMobility Sensors 1.2. - - \table - \row - \li \l {Porting Applications from QtMobility Sensors to Qt Sensors}{Porting Guide} - \li Information about the steps needed to port applications to the Qt Sensors API. - \endtable - - - \section1 Information for Qt SensorGestures API - - Qt SensorGestures provides a motion gesture recognition API for devices. - - \table - \row - \li \l {SensorGesture}{QML API} - \li Information about the Qt SensorGestures QML API - \row - \li \l {QtSensorGestures C++ API}{C++ API} - \li Information about the Qt SensorGestures C++ API - \endtable - - \section1 Information for Qt SensorGestures Recognizer Plugin Implementors. - - \table - \row - \li \l {QtSensorGestures Plugins}{Plugins} - \li Information about the Qt SensorGestures recognizer plugins. - \row - \li \l {QtSensorGestures Emulator}{Emulator} - \li Information about Qt SensorGestures use in the Emulator. - \endtable - - \section1 Platform-specific Information - \table - \row - \li \l {Compatibility Map}{Compatibility Map} - \li Compatibility map of all supported platforms. - \row - \li \l {Generic Backend}{Generic Backend} - \li Information about the generic sensor backend. - \endtable -*/ - diff --git a/doc/src/snippets/sensorgestures/creating.cpp b/doc/src/snippets/sensorgestures/creating.cpp deleted file mode 100644 index 214f2d4..0000000 --- a/doc/src/snippets/sensorgestures/creating.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -class MyObject : public QObject -{ - void create(); -public slots: - void gestureDetected(const QString &); -}; - -void MyObject::create() -{ -//! [Receiving sensor gesture signals] - -// Create a QSensorGestureManager - QSensorGestureManager gestureManager; - -// Get a list of known recognizers - QStringList recognizersList = gestureManager.gestureIds(); - -// Create a QSensorGeture object for each of those gesture recognizers - QSensorGesture *gesture = new QSensorGesture( gestureManager.gestureIds(), this); -// Connect the known signals up. - connect(gesture, SIGNAL(detected(QString)), this, SLOT(gestureDetected(QString))); -//! [Receiving sensor gesture signals] -} - -void MyObject::gestureDetected(const QString &gesture) -{ - Q_UNUSED(gesture); -} - diff --git a/doc/src/snippets/sensorgestures/main.cpp b/doc/src/snippets/sensorgestures/main.cpp deleted file mode 100644 index 08db48c..0000000 --- a/doc/src/snippets/sensorgestures/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -int main(int /*argc*/, char ** /*argv*/) -{ - return 0; -} - diff --git a/doc/src/snippets/sensorgestures/myplugin.h b/doc/src/snippets/sensorgestures/myplugin.h deleted file mode 100644 index d75f3ce..0000000 --- a/doc/src/snippets/sensorgestures/myplugin.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MYPLUGIN_H -#define MYPLUGIN_H - -#include -#include -#include - -class MySensorGestureRecognizer : public QSensorGestureRecognizer -{ - Q_OBJECT - public: - - MySensorGestureRecognizer(QObject *parent = 0); - ~MySensorGestureRecognizer(); - - void create(); - - QString id() const; - bool start(); - bool stop(); - bool isActive(); - -Q_SIGNALS: -// all signals will get exported to QSensorGesture - void mySignal(); -}; - -class MySensorGesturePlugin : public QObject, public QSensorGesturePluginInterface -{ - Q_OBJECT - //Q_PLUGIN_METADATA(IID "com.Nokia.QSensorGesturePluginInterface" FILE "plugin.json") - Q_INTERFACES(QSensorGesturePluginInterface) -public: - - explicit MySensorGesturePlugin(); - ~MySensorGesturePlugin(); - - QList createRecognizers(); - QStringList supportedIds() const; - QString name() const { return "MyGestures"; } -}; - -#endif diff --git a/doc/src/snippets/sensorgestures/plugin.cpp b/doc/src/snippets/sensorgestures/plugin.cpp deleted file mode 100644 index 7798290..0000000 --- a/doc/src/snippets/sensorgestures/plugin.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "myplugin.h" - -#include -#include - -//! [Plugin] - -MySensorGestureRecognizer::MySensorGestureRecognizer(QObject *parent) - : QSensorGestureRecognizer(parent) -{ -} - -MySensorGestureRecognizer::~MySensorGestureRecognizer() -{ -} - -bool MySensorGestureRecognizer::start() -{ - Q_EMIT mySignal(); - return true; -} - -bool MySensorGestureRecognizer::stop() -{ - return true; -} - -bool MySensorGestureRecognizer::isActive() -{ - return true; -} - -void MySensorGestureRecognizer::create() -{ -} - -QString MySensorGestureRecognizer::id() const -{ - return QString("QtSensors.mygestures"); -} - - -MySensorGesturePlugin::MySensorGesturePlugin(){} -MySensorGesturePlugin::~MySensorGesturePlugin(){} - -QList MySensorGesturePlugin::createRecognizers() -{ - QList recognizers; - MySensorGestureRecognizer *recognizer = new MySensorGestureRecognizer(this); - recognizers.append(recognizer); - - return recognizers; -} - -QStringList MySensorGesturePlugin::supportedIds() const -{ - return QStringList() << "QtSensors.mygestures"; -} - -//! [Plugin] diff --git a/doc/src/snippets/sensorgestures/sensorgestures.pro b/doc/src/snippets/sensorgestures/sensorgestures.pro deleted file mode 100644 index 46d6825..0000000 --- a/doc/src/snippets/sensorgestures/sensorgestures.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE=app -TARGET=sensorgesturessdocsnippet -QT += sensors -SOURCES+=main.cpp\ - creating.cpp\ - plugin.cpp -HEADERS+=myplugin.h -!win32:*g++*:LIBS+=-rdynamic diff --git a/doc/src/snippets/sensors/creating.cpp b/doc/src/snippets/sensors/creating.cpp deleted file mode 100644 index 01e3e36..0000000 --- a/doc/src/snippets/sensors/creating.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -class MyObject : public QObject -{ - void create(); -}; - -void MyObject::create() -{ -//! [Creating a sensor] -// On the heap (deleted when this object is deleted) -QAccelerometer *sensor = new QAccelerometer(this); - -// On the stack (deleted when the current scope ends) -QOrientationSensor orient_sensor; -//! [Creating a sensor] - - Q_UNUSED(sensor) - Q_UNUSED(orient_sensor); -} - diff --git a/doc/src/snippets/sensors/main.cpp b/doc/src/snippets/sensors/main.cpp deleted file mode 100644 index 08db48c..0000000 --- a/doc/src/snippets/sensors/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -int main(int /*argc*/, char ** /*argv*/) -{ - return 0; -} - diff --git a/doc/src/snippets/sensors/mybackend.h b/doc/src/snippets/sensors/mybackend.h deleted file mode 100644 index 49d9d3c..0000000 --- a/doc/src/snippets/sensors/mybackend.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MYBACKEND_H -#define MYBACKEND_H - -#include -#include - -class MyBackend : public QSensorBackend -{ -public: - MyBackend(QSensor *sensor) : QSensorBackend(sensor) {} - void stop() {} - void start() {} - void poll() {} - - static const char *id; -}; - -#endif diff --git a/doc/src/snippets/sensors/plugin.cpp b/doc/src/snippets/sensors/plugin.cpp deleted file mode 100644 index e467128..0000000 --- a/doc/src/snippets/sensors/plugin.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mybackend.h" -#include -#include - -const char *MyBackend::id = "mybackend"; - -//! [Plugin] -class MyPluginClass : public QObject, public QSensorPluginInterface, public QSensorBackendFactory -{ - Q_OBJECT - //Q_PLUGIN_METADATA(IID "com.nokia.Qt.QSensorPluginInterface/1.0" FILE "plugin.json") - Q_INTERFACES(QSensorPluginInterface) -public: - void registerSensors() - { - QSensorManager::registerBackend(QAccelerometer::type, MyBackend::id, this); - } - - QSensorBackend *createBackend(QSensor *sensor) - { - if (sensor->identifier() == MyBackend::id) - return new MyBackend(sensor); - return 0; - } -}; -//! [Plugin] - -#include "plugin.moc" diff --git a/doc/src/snippets/sensors/sensors.pro b/doc/src/snippets/sensors/sensors.pro deleted file mode 100644 index 20b5ae5..0000000 --- a/doc/src/snippets/sensors/sensors.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE=app -TARGET=sensorsdocsnippet -QT += sensors -SOURCES+=main.cpp\ - creating.cpp\ - start.cpp\ - plugin.cpp -HEADERS+=mybackend.h -!win32:*g++*:LIBS+=-rdynamic -OTHER_FILES += *.qml diff --git a/doc/src/snippets/sensors/start.cpp b/doc/src/snippets/sensors/start.cpp deleted file mode 100644 index d8cbd99..0000000 --- a/doc/src/snippets/sensors/start.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -void start() -{ -//! [Starting a sensor] -// start the sensor -QSensor sensor("QAccelerometer"); -sensor.start(); - -// later -QSensorReading *reading = sensor.reading(); -qreal x = reading->property("x").value(); -qreal y = reading->value(1).value(); -//! [Starting a sensor] - - Q_UNUSED(x) - Q_UNUSED(y) -} diff --git a/doc/src/snippets/snippets.pro b/doc/src/snippets/snippets.pro deleted file mode 100644 index f73d4a3..0000000 --- a/doc/src/snippets/snippets.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += sensors -SUBDIRS += sensorgestures - diff --git a/examples/sensors/accel/accel.pro b/examples/sensors/accel/accel.pro deleted file mode 100644 index 82fa706..0000000 --- a/examples/sensors/accel/accel.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE=app -TARGET=accel - -QT=core sensors - -SOURCES=main.cpp - -target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/accel -INSTALLS += target diff --git a/examples/sensors/accel/main.cpp b/examples/sensors/accel/main.cpp deleted file mode 100644 index 2985536..0000000 --- a/examples/sensors/accel/main.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QAccelerometer *accelerometer; - -class AccelerometerFilter : public QAccelerometerFilter -{ -public: - bool filter(QAccelerometerReading *reading) - { - qDebug() << "acceleration: " - << QString().sprintf("%0.2f %0.2f %0.2f", - reading->x(), - reading->y(), - reading->z()); - return false; // don't store the reading in the sensor - } -}; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - QAccelerometer sensor; - accelerometer = &sensor; - AccelerometerFilter filter; - sensor.addFilter(&filter); - sensor.start(); - - if (!sensor.isActive()) { - qWarning("Accelerometer didn't start!"); - return 1; - } - - return app.exec(); -} - diff --git a/examples/sensors/accelbubble/doc/src/accelbubble.qdoc b/examples/sensors/accelbubble/doc/src/accelbubble.qdoc new file mode 100644 index 0000000..83c5d3d --- /dev/null +++ b/examples/sensors/accelbubble/doc/src/accelbubble.qdoc @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example accelbubble + \title Qt Sensors - Accel Bubble + \brief The AccelBubble example demonstrates the Legacy Accelerometer QML type. + \ingroup qtsensors-examples + +\section1 Overview + Writing a QML application that uses the Legacy Accelerometer QML sensors type requires the following steps: + + Import the Legacy Sensors Declarative module. + +\snippet accelbubble/accelbubble.qml 0 + + Add an Accelerometer QML type. + +\snippet accelbubble/accelbubble.qml 1 + + Use the 'active' property to start the sensor + +\snippet accelbubble/accelbubble.qml 2 + + Move the bubble according to a factor of the accelerator sensor + +\snippet accelbubble/accelbubble.qml 3 + +*/ + diff --git a/examples/sensors/cubehouse/doc/src/cubehouse.qdoc b/examples/sensors/cubehouse/doc/src/cubehouse.qdoc new file mode 100644 index 0000000..e286e32 --- /dev/null +++ b/examples/sensors/cubehouse/doc/src/cubehouse.qdoc @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example cubehouse + \title Qt Sensors - 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. + \image cubehouse.png + +\section1 Overview + To write a QML application that will use the QML Accelerometer type from the QtSensors import you need to to the following steps: + + Import the QtSensors declarative plugin: + +\snippet cubehouse/cubehouse.qml 0 + + Add the Accelerometer QML types into your qml file. + +\snippet cubehouse/cubehouse.qml 1 + + In additional two properties are added to save the calculated pitch and roll values: + +\snippet 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 type: + +\snippet cubehouse/cubehouse.qml 3 + + By using a timer the view can be rotated using the pitch and roll properties from the Accelerometer type: + +\snippet cubehouse/cubehouse.qml 4 + +*/ + diff --git a/examples/sensors/grue/doc/src/grue.qdoc b/examples/sensors/grue/doc/src/grue.qdoc new file mode 100644 index 0000000..9a0d447 --- /dev/null +++ b/examples/sensors/grue/doc/src/grue.qdoc @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page gruesensorexample.html + \title Qt Sensors - Grue Sensor Example + \brief The Qt Sensors - Grue sensor example demonstrates all the steps from creating a new sensor to using it. + \ingroup qtsensors-examples + + The Qt Sensors - Grue sensor example demonstrates all the steps from creating a new sensor to using it. + + The sensor definition is placed in a library where client apps can access it. The actual implementation + lives in a plugin. + + \list + \li \l{Grue Sensor Definition} + \li \l{Grue Sensor Implementation} + \endlist + + The sensor can now be used by a C++ application, even if the application does not have access to the + definition. + + \list + \li \l{Grue Sensor Console Application} + \endlist + + To make the sensor available to a QML application an import must be created. + + \list + \li \l{Grue Sensor QML Import} + \li \l{Grue Sensor QML Application} + \endlist +*/ + +/*! + \example grue/lib + \title Grue Sensor Definition + \brief The Grue sensor is defined in a library so that applications can use it. + + First up is the sensor type. This is the interface for sensors that report + on your likelihood of being eaten by a Grue. Such sensors are very important + to adventurers, particularly if they are going into dark places as this is + where Grues live. + + The interface is a simple one. It provides only 1 piece of information, your + chance of being eaten. For the details on how this is property should be + interpreted please see the documentation in gruesensor.cpp. + + This example was created using the make_sensor.pl script which can be found in + src/sensors. As such, it contains some generated code that defines the convenience + classes GrueFilter and GrueSensor. + + \sa {Qt Sensors - Grue Sensor Example} +*/ + +/*! + \example grue/plugin + \title Grue Sensor Implementation + \brief The Grue sensor implementation lives in a plugin that is loaded by the Qt Sensors library. + + The Grue sensor needs a backend before it can be used. The backend provided + is rather basic and it relies on some kind of light sensor to work but it + gets the job done. If new hardware that can detect the actual presence of Grues + becomes available a backend could be created that supports this hardware and + applications using the Grue sensor would be able to use it without any changes. + + There are a few mandatory parts to a backend. They are the start and stop methods + and the setReading call. The start and stop methods are used to start and stop + any underlying hardware. In the case of this backend they start and stop a + light sensor. In the start method, the backend should be sure to call the + sensorStopped() or sensorBusy() methods if it cannot start. + + \snippet 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 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. + + \code + // Create a reading instance for us to use + m_reading = setReading(0); + \endcode + + The Grue sensor backend also supplies some metadata. + + The backend checks 2 things, how dark it is and how long you have been in the dark. + It uses the readingChanged() signal to know when to check the light sensor's + value. Once it is dark, it uses a timer to increase your chance of being eaten. + + The Grue sensor backend is delivered as a plugin. The plugin has a factory object + that registers the types available and does the actual instantiation of the backend. + + \sa {Qt Sensors - Grue Sensor Example} +*/ + +/*! + \example grue/console_app + \title Grue Sensor Console Application + \brief The Grue sensor console application demonstrates use of the Grue sensor. + + This is a simple commandline application. It demonstrates how to use the generic + access feature of Qt Sensors to avoid a link-time dependency on the Grue Sensor + library. + + \sa {Qt Sensors - Grue Sensor Example} +*/ + +/*! + \example grue/import + \title Grue Sensor QML Import + \brief The Grue sensor QML import exports the GrueSensor class as a QML type. + + This example creates the \e {Grue 1.0} import. + + \sa {Qt Sensors - Grue Sensor Example} +*/ + +/*! + \example grue + \title Grue Sensor QML Application + \brief The Grue sensor QML application demonstrates use of the GrueSensor QML type. + + This is a pure QML application that can be run from Qt Creator or directly using the + \c qmlscene binary. You should install the other projects before trying to run + this example or it will not be able to find its dependencies. + + \code + qmlscene grue.qml + \endcode + + \sa {Qt Sensors - Grue Sensor Example} +*/ + diff --git a/examples/sensors/maze/doc/src/maze.qdoc b/examples/sensors/maze/doc/src/maze.qdoc new file mode 100644 index 0000000..d9b50be --- /dev/null +++ b/examples/sensors/maze/doc/src/maze.qdoc @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example 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 type. + + + To write a QML application that will use the TiltSensor QML sensors type you need to do the following steps: + + Import the QtSensors 5.x declarative plugin: + + \snippet maze/maze.qml 0 + + Add the Sensor QML types into your qml file. + + In this example we use the TiltSensor with values based in degrees and an accuracy of 5 degree: + + \snippet maze/maze.qml 1 + + Starting the sensor can be done by setting the 'enabled' property to true: + + \snippet maze/maze.qml 2 + + The mouse should move by a factor of the tilt value: + + \snippet maze/maze.qml 3 + + The walk direction of the mouse takes into account some collision detection: + + \snippet maze/maze.qml 4 + + The rotation of the mouse image is determined according to the angle that the mouse is moving. + + \snippet maze/Mouse.qml 0 + +*/ + diff --git a/examples/sensors/qmlqtsensors/doc/src/qmlqtsensors.qdoc b/examples/sensors/qmlqtsensors/doc/src/qmlqtsensors.qdoc new file mode 100644 index 0000000..f6b4738 --- /dev/null +++ b/examples/sensors/qmlqtsensors/doc/src/qmlqtsensors.qdoc @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example qmlqtsensors + \title Qt Sensors - QML example + \ingroup qtsensors-examples + \image qmlqtsensors.png + + \section2 Qt Sensors in QML + \brief The QtSensors - QML example demonstrates the QML sensors types in the QtSensors 5 import. + + + To write a QML application that will use the QML sensors types in the QtSensors 5 import you need to to the following steps: + + Import the QtSensors 5.x declarative plugin: + + \snippet qmlqtsensors/qmlqtsensors.qml 0 + + Add the Sensor QML types into your qml file. + + In this example we use the TiltSensor: + + \snippet qmlqtsensors/qmlqtsensors.qml 1 + + The Tilt-, AmbientLight- and the Proximity QML sensor types have the 'enabled' property in common. + To start or stop the sensor set this property to true or false. + + \snippet qmlqtsensors/qmlqtsensors.qml 2 + + Reading the data can be done for each sensor type like following: + + \l {QtSensors::TiltSensor} {TiltSensor} + + \snippet qmlqtsensors/qmlqtsensors.qml 3 + \snippet qmlqtsensors/qmlqtsensors.qml 4 + + \l {QtSensors::AmbientLightSensor} {AmbientLightSensor} + + \snippet qmlqtsensors/qmlqtsensors.qml 5 + + \l {QtSensors::ProximitySensor} {ProximitySensor} + + \snippet qmlqtsensors/qmlqtsensors.qml 6 +*/ + diff --git a/examples/sensors/qmlsensorgestures/doc/src/qmlsensorgtestures.qdoc b/examples/sensors/qmlsensorgestures/doc/src/qmlsensorgtestures.qdoc new file mode 100644 index 0000000..83f3171 --- /dev/null +++ b/examples/sensors/qmlsensorgestures/doc/src/qmlsensorgtestures.qdoc @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example qmlsensorgestures + \title Qt Sensors - SensorGesture QML Type example + \ingroup qtsensors-examples + + \brief This example demonstrates use of the SensorGesture QML type. + +\section1 Overview + To write a QML application that will use the gesture plugin you need to to the following steps: + + Import the QtSensors 5.x declarative plugin: + +\snippet qmlsensorgestures/GestureView.qml 0 + + Add the SensorGesture QML type into your qml file. + +\snippet qmlsensorgestures/GestureView.qml 1 + + Each SensorGesture QML type contains a property called gestures. + + In this example an alias 'gestureid' for this property is used. + +\snippet qmlsensorgestures/GestureView.qml 2 + + By using this alias property you define which gestures should be used: + +\snippet qmlsensorgestures/qmlsensorgestures.qml 3 + + A list of all available gestures can be created by calling the 'availableGestures' property: + +\snippet qmlsensorgestures/GestureList.qml 4 + +\sa {Qt Sensors - ShakeIt QML Example} +\sa {Qt Sensor Gestures} +*/ + diff --git a/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc b/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc new file mode 100644 index 0000000..be04215 --- /dev/null +++ b/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example sensor_explorer + \title Qt Sensors - Explorer QML example + \ingroup qtsensors-examples + + \section2 Sensor Explorer in QML + \brief The Sensor Explorer example demonstrates how to read the meta-data of available sensors. + + + This example is divided into two parts: + + \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 + + + This is a pure QML application that can be run from Qt Creator or directly using the + \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 + + To write a QML application that will use the Explorer QML type you need to do the following steps: + + Import the Explorer 1.0 declarative plugin: + + \snippet sensor_explorer/sensor_explorer.qml 0 + + Create a SensorExplorer QML item: + + \snippet sensor_explorer/sensor_explorer.qml 1 + + You can retrieve a list of all available sensors using the SensorExplorer: + + \snippet sensor_explorer/sensor_explorer.qml 2 + + To retrieve the properties of a SensorItem use: + + \snippet sensor_explorer/sensor_explorer.qml 3 + + Changing a property value can be done like: + + \snippet sensor_explorer/sensor_explorer.qml 4 + + Starting and stopping a sensor can be done like: + + \snippet sensor_explorer/sensor_explorer.qml 5 +*/ + +/*! + \example 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 type. + + This example creates the \e {Explorer 1.0} import. + + \sa {Qt Sensors - Explorer QML example} +*/ + diff --git a/examples/sensors/sensorgestures/doc/images/sensorgesturecpp.png b/examples/sensors/sensorgestures/doc/images/sensorgesturecpp.png new file mode 100644 index 0000000..4d453cf Binary files /dev/null and b/examples/sensors/sensorgestures/doc/images/sensorgesturecpp.png differ diff --git a/examples/sensors/sensorgestures/doc/src/sensorgestures.qdoc b/examples/sensors/sensorgestures/doc/src/sensorgestures.qdoc new file mode 100644 index 0000000..a5c96cb --- /dev/null +++ b/examples/sensors/sensorgestures/doc/src/sensorgestures.qdoc @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example sensorgestures + \title Qt Sensors - 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 &) } + + As well, Sensor Gesture Recognizers may implement any number of their own custom signals. + + Our shake recognizer defines one custom signal, \c {void shake()}, as well as the predefined + detected signal. + + \section1 SensorGestures Class Implementation + + 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 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 sensorgestures/mainwindow.cpp 1 + + and later stop the detection process. + + \snippet sensorgestures/mainwindow.cpp 2 + + The QSensorGesture object will contain all the signals of the valid requested recognizers found on the system. + + You can discover which of the requested recognizer ID's that were not found by using QSensorGesture::invalidIds(); + + By using QSensorGesture::gestureSignals(), you can get a QStringList of usable signals. + + +*/ diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro index 7fe9a09..f98b4c1 100644 --- a/examples/sensors/sensors.pro +++ b/examples/sensors/sensors.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS += accel grue +SUBDIRS += grue !isEmpty(QT.quick.name) { SUBDIRS += \ diff --git a/examples/sensors/shakeit/doc/images/shakeit.png b/examples/sensors/shakeit/doc/images/shakeit.png new file mode 100644 index 0000000..5ca1b58 Binary files /dev/null and b/examples/sensors/shakeit/doc/images/shakeit.png differ diff --git a/examples/sensors/shakeit/doc/src/shakeit.qdoc b/examples/sensors/shakeit/doc/src/shakeit.qdoc new file mode 100644 index 0000000..8f5931f --- /dev/null +++ b/examples/sensors/shakeit/doc/src/shakeit.qdoc @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example 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. + + Writing a QML application that uses the Shake QML sensorgestures type requires the following steps: + + Import the Sensors Declarative module. + + \snippet shakeit/shakeit.qml 0 + + Add a SensorGesture QML type. + + \snippet shakeit/shakeit.qml 1 + + In the SensorGesture type, 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 shakeit/shakeit.qml 2 + + Use the 'enabled' property to start the sensor gesture. + + \snippet shakeit/shakeit.qml 3 + + Use the onDetected signal to do stuff. + + \snippet shakeit/shakeit.qml 4 + + There are additional gestures to shake which are supported: + whip, twistRight, hover, cover, turnover and pickup. +*/ diff --git a/qtsensors.pro b/qtsensors.pro index e76adec..83d9ebd 100644 --- a/qtsensors.pro +++ b/qtsensors.pro @@ -6,11 +6,6 @@ blackberry { load(qt_parts) -SUBDIRS += module_qtsensors_snippets -module_qtsensors_snippets.subdir = doc/src/snippets -module_qtsensors_snippets.target = sub-snippets -module_qtsensors_snippets.depends = sub_src - # Commands to rebuild the plugin.qmltypes files for our imports # Run "make rebuild_qmltypes" after completing a build sensors_qmltypes.commands = qmlplugindump QtSensors 5.0 $$QT.sensors.imports > $$PWD/src/imports/sensors/plugins.qmltypes diff --git a/src/sensors/doc/images/XAngle.gif b/src/sensors/doc/images/XAngle.gif new file mode 100644 index 0000000..045f235 Binary files /dev/null and b/src/sensors/doc/images/XAngle.gif differ diff --git a/src/sensors/doc/images/XAngleNegative.gif b/src/sensors/doc/images/XAngleNegative.gif new file mode 100644 index 0000000..92fc923 Binary files /dev/null and b/src/sensors/doc/images/XAngleNegative.gif differ diff --git a/src/sensors/doc/images/YAngle.gif b/src/sensors/doc/images/YAngle.gif new file mode 100644 index 0000000..004fdd1 Binary files /dev/null and b/src/sensors/doc/images/YAngle.gif differ diff --git a/src/sensors/doc/images/YAngleNegative.gif b/src/sensors/doc/images/YAngleNegative.gif new file mode 100644 index 0000000..1dce653 Binary files /dev/null and b/src/sensors/doc/images/YAngleNegative.gif differ diff --git a/src/sensors/doc/images/cubehouse.png b/src/sensors/doc/images/cubehouse.png new file mode 100644 index 0000000..e3ff7fa Binary files /dev/null and b/src/sensors/doc/images/cubehouse.png differ diff --git a/src/sensors/doc/images/maze.png b/src/sensors/doc/images/maze.png new file mode 100644 index 0000000..f3ad8de Binary files /dev/null and b/src/sensors/doc/images/maze.png differ diff --git a/src/sensors/doc/images/qmlqtsensors.png b/src/sensors/doc/images/qmlqtsensors.png new file mode 100644 index 0000000..0a54b65 Binary files /dev/null and b/src/sensors/doc/images/qmlqtsensors.png differ diff --git a/src/sensors/doc/images/sensorgesture-cover.png b/src/sensors/doc/images/sensorgesture-cover.png new file mode 100644 index 0000000..7b4fbc5 Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-cover.png differ diff --git a/src/sensors/doc/images/sensorgesture-doubletap.png b/src/sensors/doc/images/sensorgesture-doubletap.png new file mode 100644 index 0000000..6253d0f Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-doubletap.png differ diff --git a/src/sensors/doc/images/sensorgesture-facedown.png b/src/sensors/doc/images/sensorgesture-facedown.png new file mode 100644 index 0000000..a85664f Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-facedown.png differ diff --git a/src/sensors/doc/images/sensorgesture-faceup.png b/src/sensors/doc/images/sensorgesture-faceup.png new file mode 100644 index 0000000..c20ef08 Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-faceup.png differ diff --git a/src/sensors/doc/images/sensorgesture-flat.png b/src/sensors/doc/images/sensorgesture-flat.png new file mode 100644 index 0000000..e8eafaf Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-flat.png differ diff --git a/src/sensors/doc/images/sensorgesture-hover.png b/src/sensors/doc/images/sensorgesture-hover.png new file mode 100644 index 0000000..fecf6b3 Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-hover.png differ diff --git a/src/sensors/doc/images/sensorgesture-shake.png b/src/sensors/doc/images/sensorgesture-shake.png new file mode 100644 index 0000000..06f9eea Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-shake.png differ diff --git a/src/sensors/doc/images/sensorgesture-slam_1.png b/src/sensors/doc/images/sensorgesture-slam_1.png new file mode 100644 index 0000000..d56f889 Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-slam_1.png differ diff --git a/src/sensors/doc/images/sensorgesture-slam_2.png b/src/sensors/doc/images/sensorgesture-slam_2.png new file mode 100644 index 0000000..5fe8ecb Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-slam_2.png differ diff --git a/src/sensors/doc/images/sensorgesture-twist.png b/src/sensors/doc/images/sensorgesture-twist.png new file mode 100644 index 0000000..bec1585 Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-twist.png differ diff --git a/src/sensors/doc/images/sensorgesture-whip.png b/src/sensors/doc/images/sensorgesture-whip.png new file mode 100644 index 0000000..aa998bb Binary files /dev/null and b/src/sensors/doc/images/sensorgesture-whip.png differ diff --git a/src/sensors/doc/images/sensors-coordinates.jpg b/src/sensors/doc/images/sensors-coordinates.jpg new file mode 100644 index 0000000..e2e9890 Binary files /dev/null and b/src/sensors/doc/images/sensors-coordinates.jpg differ diff --git a/src/sensors/doc/images/sensors-coordinates2.jpg b/src/sensors/doc/images/sensors-coordinates2.jpg new file mode 100644 index 0000000..8dd43a2 Binary files /dev/null and b/src/sensors/doc/images/sensors-coordinates2.jpg differ diff --git a/src/sensors/doc/images/sensors-coordinates3.jpg b/src/sensors/doc/images/sensors-coordinates3.jpg new file mode 100644 index 0000000..0263400 Binary files /dev/null and b/src/sensors/doc/images/sensors-coordinates3.jpg differ diff --git a/src/sensors/doc/images/sensors-dynamic.png b/src/sensors/doc/images/sensors-dynamic.png new file mode 100644 index 0000000..d2ba937 Binary files /dev/null and b/src/sensors/doc/images/sensors-dynamic.png differ diff --git a/src/sensors/doc/images/sensors-geo-vs-raw-magnetism.jpg b/src/sensors/doc/images/sensors-geo-vs-raw-magnetism.jpg new file mode 100644 index 0000000..272fa31 Binary files /dev/null and b/src/sensors/doc/images/sensors-geo-vs-raw-magnetism.jpg differ diff --git a/src/sensors/doc/images/sensors-orientation.jpg b/src/sensors/doc/images/sensors-orientation.jpg new file mode 100644 index 0000000..245533d Binary files /dev/null and b/src/sensors/doc/images/sensors-orientation.jpg differ diff --git a/src/sensors/doc/images/sensors-overview.png b/src/sensors/doc/images/sensors-overview.png new file mode 100644 index 0000000..29e9ebd Binary files /dev/null and b/src/sensors/doc/images/sensors-overview.png differ diff --git a/src/sensors/doc/images/sensors-rotation-anim.gif b/src/sensors/doc/images/sensors-rotation-anim.gif new file mode 100644 index 0000000..22c678d Binary files /dev/null and b/src/sensors/doc/images/sensors-rotation-anim.gif differ diff --git a/src/sensors/doc/images/sensors-rotation.jpg b/src/sensors/doc/images/sensors-rotation.jpg new file mode 100644 index 0000000..1bd1b14 Binary files /dev/null and b/src/sensors/doc/images/sensors-rotation.jpg differ diff --git a/src/sensors/doc/images/sensors-rotation2.jpg b/src/sensors/doc/images/sensors-rotation2.jpg new file mode 100644 index 0000000..1bf34fe Binary files /dev/null and b/src/sensors/doc/images/sensors-rotation2.jpg differ diff --git a/src/sensors/doc/images/sensors-rotation3.jpg b/src/sensors/doc/images/sensors-rotation3.jpg new file mode 100644 index 0000000..d69a3e1 Binary files /dev/null and b/src/sensors/doc/images/sensors-rotation3.jpg differ diff --git a/src/sensors/doc/images/sensors-sides.jpg b/src/sensors/doc/images/sensors-sides.jpg new file mode 100644 index 0000000..8e84224 Binary files /dev/null and b/src/sensors/doc/images/sensors-sides.jpg differ diff --git a/src/sensors/doc/images/sensors-sides2.jpg b/src/sensors/doc/images/sensors-sides2.jpg new file mode 100644 index 0000000..db66a9b Binary files /dev/null and b/src/sensors/doc/images/sensors-sides2.jpg differ diff --git a/src/sensors/doc/images/sensors-static.png b/src/sensors/doc/images/sensors-static.png new file mode 100644 index 0000000..657aaad Binary files /dev/null and b/src/sensors/doc/images/sensors-static.png differ diff --git a/src/sensors/doc/qtsensors.qdocconf b/src/sensors/doc/qtsensors.qdocconf new file mode 100644 index 0000000..c2d27bc --- /dev/null +++ b/src/sensors/doc/qtsensors.qdocconf @@ -0,0 +1,47 @@ +include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf) +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtSensors +description = Qt Contacts Reference Documentation +url = http://qt-project.org/doc/qt-5.0/qtsensors-index.html +version = 5.0.0 + +qhp.projects = QtSensors + +qhp.QtSensors.file = qtsensors.qhp +qhp.QtSensors.namespace = org.qt-project.qtsensors.500 +qhp.QtSensors.virtualFolder = qdoc +qhp.QtSensors.indexTitle = Qt Sensors Reference Documentation +qhp.QtSensors.indexRoot = + +qhp.QtSensors.filterAttributes = qtsensors 5.0.0 qtrefdoc +qhp.QtSensors.customFilters.Qt.name = QtSensors 5.0.0 +qhp.QtSensors.customFilters.Qt.filterAttributes = qtsensors 5.0.0 +qhp.QtSensors.subprojects = classes overviews examples +qhp.QtSensors.subprojects.classes.title = Classes +qhp.QtSensors.subprojects.classes.indexTitle = Qt Sensors's Classes +qhp.QtSensors.subprojects.classes.selectors = class fake:headerfile +qhp.QtSensors.subprojects.classes.sortPages = true +qhp.QtSensors.subprojects.overviews.title = Overviews +qhp.QtSensors.subprojects.overviews.indexTitle = All Overviews and HOWTOs +qhp.QtSensors.subprojects.overviews.selectors = fake:page,group,module +qhp.QtSensors.subprojects.examples.title = Qt Sensors Examples +qhp.QtSensors.subprojects.examples.indexTitle = Qt Sensors Examples +qhp.QtSensors.subprojects.examples.selectors = fake:example + +outputdir = ../../../doc/qtsensors +tagfile = ../../../doc/qtsensors/qtsensors.tags + +headerdirs += .. \ + ../../imports/sensors2 \ + ../../plugins/sensors + +sourcedirs += .. \ + ../../imports/sensors2 \ + ../../plugins/sensors + +exampledirs += ../../../examples/sensors \ + snippets/ + + +imagedirs += images diff --git a/src/sensors/doc/snippets/sensorgestures/creating.cpp b/src/sensors/doc/snippets/sensorgestures/creating.cpp new file mode 100644 index 0000000..214f2d4 --- /dev/null +++ b/src/sensors/doc/snippets/sensorgestures/creating.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class MyObject : public QObject +{ + void create(); +public slots: + void gestureDetected(const QString &); +}; + +void MyObject::create() +{ +//! [Receiving sensor gesture signals] + +// Create a QSensorGestureManager + QSensorGestureManager gestureManager; + +// Get a list of known recognizers + QStringList recognizersList = gestureManager.gestureIds(); + +// Create a QSensorGeture object for each of those gesture recognizers + QSensorGesture *gesture = new QSensorGesture( gestureManager.gestureIds(), this); +// Connect the known signals up. + connect(gesture, SIGNAL(detected(QString)), this, SLOT(gestureDetected(QString))); +//! [Receiving sensor gesture signals] +} + +void MyObject::gestureDetected(const QString &gesture) +{ + Q_UNUSED(gesture); +} + diff --git a/src/sensors/doc/snippets/sensorgestures/main.cpp b/src/sensors/doc/snippets/sensorgestures/main.cpp new file mode 100644 index 0000000..08db48c --- /dev/null +++ b/src/sensors/doc/snippets/sensorgestures/main.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int /*argc*/, char ** /*argv*/) +{ + return 0; +} + diff --git a/src/sensors/doc/snippets/sensorgestures/myplugin.h b/src/sensors/doc/snippets/sensorgestures/myplugin.h new file mode 100644 index 0000000..d75f3ce --- /dev/null +++ b/src/sensors/doc/snippets/sensorgestures/myplugin.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MYPLUGIN_H +#define MYPLUGIN_H + +#include +#include +#include + +class MySensorGestureRecognizer : public QSensorGestureRecognizer +{ + Q_OBJECT + public: + + MySensorGestureRecognizer(QObject *parent = 0); + ~MySensorGestureRecognizer(); + + void create(); + + QString id() const; + bool start(); + bool stop(); + bool isActive(); + +Q_SIGNALS: +// all signals will get exported to QSensorGesture + void mySignal(); +}; + +class MySensorGesturePlugin : public QObject, public QSensorGesturePluginInterface +{ + Q_OBJECT + //Q_PLUGIN_METADATA(IID "com.Nokia.QSensorGesturePluginInterface" FILE "plugin.json") + Q_INTERFACES(QSensorGesturePluginInterface) +public: + + explicit MySensorGesturePlugin(); + ~MySensorGesturePlugin(); + + QList createRecognizers(); + QStringList supportedIds() const; + QString name() const { return "MyGestures"; } +}; + +#endif diff --git a/src/sensors/doc/snippets/sensorgestures/plugin.cpp b/src/sensors/doc/snippets/sensorgestures/plugin.cpp new file mode 100644 index 0000000..7798290 --- /dev/null +++ b/src/sensors/doc/snippets/sensorgestures/plugin.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "myplugin.h" + +#include +#include + +//! [Plugin] + +MySensorGestureRecognizer::MySensorGestureRecognizer(QObject *parent) + : QSensorGestureRecognizer(parent) +{ +} + +MySensorGestureRecognizer::~MySensorGestureRecognizer() +{ +} + +bool MySensorGestureRecognizer::start() +{ + Q_EMIT mySignal(); + return true; +} + +bool MySensorGestureRecognizer::stop() +{ + return true; +} + +bool MySensorGestureRecognizer::isActive() +{ + return true; +} + +void MySensorGestureRecognizer::create() +{ +} + +QString MySensorGestureRecognizer::id() const +{ + return QString("QtSensors.mygestures"); +} + + +MySensorGesturePlugin::MySensorGesturePlugin(){} +MySensorGesturePlugin::~MySensorGesturePlugin(){} + +QList MySensorGesturePlugin::createRecognizers() +{ + QList recognizers; + MySensorGestureRecognizer *recognizer = new MySensorGestureRecognizer(this); + recognizers.append(recognizer); + + return recognizers; +} + +QStringList MySensorGesturePlugin::supportedIds() const +{ + return QStringList() << "QtSensors.mygestures"; +} + +//! [Plugin] diff --git a/src/sensors/doc/snippets/sensorgestures/sensorgestures.pro b/src/sensors/doc/snippets/sensorgestures/sensorgestures.pro new file mode 100644 index 0000000..46d6825 --- /dev/null +++ b/src/sensors/doc/snippets/sensorgestures/sensorgestures.pro @@ -0,0 +1,8 @@ +TEMPLATE=app +TARGET=sensorgesturessdocsnippet +QT += sensors +SOURCES+=main.cpp\ + creating.cpp\ + plugin.cpp +HEADERS+=myplugin.h +!win32:*g++*:LIBS+=-rdynamic diff --git a/src/sensors/doc/snippets/sensors/creating.cpp b/src/sensors/doc/snippets/sensors/creating.cpp new file mode 100644 index 0000000..01e3e36 --- /dev/null +++ b/src/sensors/doc/snippets/sensors/creating.cpp @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class MyObject : public QObject +{ + void create(); +}; + +void MyObject::create() +{ +//! [Creating a sensor] +// On the heap (deleted when this object is deleted) +QAccelerometer *sensor = new QAccelerometer(this); + +// On the stack (deleted when the current scope ends) +QOrientationSensor orient_sensor; +//! [Creating a sensor] + + Q_UNUSED(sensor) + Q_UNUSED(orient_sensor); +} + diff --git a/src/sensors/doc/snippets/sensors/main.cpp b/src/sensors/doc/snippets/sensors/main.cpp new file mode 100644 index 0000000..08db48c --- /dev/null +++ b/src/sensors/doc/snippets/sensors/main.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int /*argc*/, char ** /*argv*/) +{ + return 0; +} + diff --git a/src/sensors/doc/snippets/sensors/mybackend.h b/src/sensors/doc/snippets/sensors/mybackend.h new file mode 100644 index 0000000..49d9d3c --- /dev/null +++ b/src/sensors/doc/snippets/sensors/mybackend.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MYBACKEND_H +#define MYBACKEND_H + +#include +#include + +class MyBackend : public QSensorBackend +{ +public: + MyBackend(QSensor *sensor) : QSensorBackend(sensor) {} + void stop() {} + void start() {} + void poll() {} + + static const char *id; +}; + +#endif diff --git a/src/sensors/doc/snippets/sensors/plugin.cpp b/src/sensors/doc/snippets/sensors/plugin.cpp new file mode 100644 index 0000000..e467128 --- /dev/null +++ b/src/sensors/doc/snippets/sensors/plugin.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "mybackend.h" +#include +#include + +const char *MyBackend::id = "mybackend"; + +//! [Plugin] +class MyPluginClass : public QObject, public QSensorPluginInterface, public QSensorBackendFactory +{ + Q_OBJECT + //Q_PLUGIN_METADATA(IID "com.nokia.Qt.QSensorPluginInterface/1.0" FILE "plugin.json") + Q_INTERFACES(QSensorPluginInterface) +public: + void registerSensors() + { + QSensorManager::registerBackend(QAccelerometer::type, MyBackend::id, this); + } + + QSensorBackend *createBackend(QSensor *sensor) + { + if (sensor->identifier() == MyBackend::id) + return new MyBackend(sensor); + return 0; + } +}; +//! [Plugin] + +#include "plugin.moc" diff --git a/src/sensors/doc/snippets/sensors/sensors.pro b/src/sensors/doc/snippets/sensors/sensors.pro new file mode 100644 index 0000000..20b5ae5 --- /dev/null +++ b/src/sensors/doc/snippets/sensors/sensors.pro @@ -0,0 +1,10 @@ +TEMPLATE=app +TARGET=sensorsdocsnippet +QT += sensors +SOURCES+=main.cpp\ + creating.cpp\ + start.cpp\ + plugin.cpp +HEADERS+=mybackend.h +!win32:*g++*:LIBS+=-rdynamic +OTHER_FILES += *.qml diff --git a/src/sensors/doc/snippets/sensors/start.cpp b/src/sensors/doc/snippets/sensors/start.cpp new file mode 100644 index 0000000..d8cbd99 --- /dev/null +++ b/src/sensors/doc/snippets/sensors/start.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +void start() +{ +//! [Starting a sensor] +// start the sensor +QSensor sensor("QAccelerometer"); +sensor.start(); + +// later +QSensorReading *reading = sensor.reading(); +qreal x = reading->property("x").value(); +qreal y = reading->value(1).value(); +//! [Starting a sensor] + + Q_UNUSED(x) + Q_UNUSED(y) +} diff --git a/src/sensors/doc/snippets/snippets.pro b/src/sensors/doc/snippets/snippets.pro new file mode 100644 index 0000000..f73d4a3 --- /dev/null +++ b/src/sensors/doc/snippets/snippets.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS += sensors +SUBDIRS += sensorgestures + diff --git a/src/sensors/doc/src/compatmap.qdoc b/src/sensors/doc/src/compatmap.qdoc new file mode 100644 index 0000000..0fd4951 --- /dev/null +++ b/src/sensors/doc/src/compatmap.qdoc @@ -0,0 +1,142 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page compatmap.html + \title Compatibility Map + \brief Overview of supported sensors for each platform + + \raw HTML + + + + + + + + + + + + + + + + +
ColorExplanation
The feature is fully supported.
The feature is not supported.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureBlackberryLinuxGeneric
Accelerometer
Ambient Light Sensor
Compass
Gyroscope
IR Proximity Sensor
Light Sensor
Magnetometer
Orientation Sensor
Proximity Sensor
Rotation Sensor
Tap Sensor
Sensor Gestures1)
+ + \endraw + + 1) Support depends on the underlying platform + + In addition to the table above, each sensor type might support specific features. For example + a magnetometer might support returning geo values. See QSensor::isFeatureSupported() for + additional details. +*/ + diff --git a/src/sensors/doc/src/genericbackend.qdoc b/src/sensors/doc/src/genericbackend.qdoc new file mode 100644 index 0000000..689b412 --- /dev/null +++ b/src/sensors/doc/src/genericbackend.qdoc @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page genericbackend.html + \title Generic Backend + \brief Information about the generic sensor backend + + The generic sensor backend provides emulation of some of the sensors that are not supported on the + platform. + For example, on a platform without a rotation sensor but with an accelerometer, the accelerometer + is used to calculate the rotation, thus providing an emulated rotation sensor. + + The following generic sensors are supported: + \table + \header + \li Emulated Sensor + \li Source Sensor + \row + \li Ambient Light Sensor + \li Light Sensor + \row + \li Orientation Sensor + \li Accelerometer + \row + \li Rotation Sensor + \li Accelerometer + \endtable + If a platform doesn't support the source sensor, then the sensor can not be emulated. +*/ + diff --git a/src/sensors/doc/src/porting.qdoc b/src/sensors/doc/src/porting.qdoc new file mode 100644 index 0000000..b52da35 --- /dev/null +++ b/src/sensors/doc/src/porting.qdoc @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtsensors-porting.html + \title Porting Applications from QtMobility Sensors to Qt Sensors + + \tableofcontents + + \section1 Overview + + The initial release of Qt Sensors (5.0) is generally expected to be source + compatible with QtMobility Sensors 1.2. This document attempts to explain + where things must be changed in order to port applications to Qt Sensors. + + \section1 QML + + Compatibility for QML applications is provided by shipping the legacy \c QtMobility.sensors + QML import. QML applications should not require any changes to continue operating. + + Applications using the legacy QML import may not be able to trivially port over + to the new QML import because the new QML import does not provide types for + every sensor like the legacy QML import does. + + \table + \row + \li \l {Qt Sensors QML Types}{QML API} + \li Information about the Qt Sensors QML API + \row + \li \l {QtMobility.sensors 1.x}{Legacy QML API} + \li Information about the legacy QtMobility.sensors QML API + \endtable + + \section1 C++ + + \section2 Includes + + QtMobility Sensors installed headers into a \c Qt Sensors directory. This is + also the directory that Qt Sensors uses. It is therefore expected that includes + that worked with QtMobility Sensors should continue to work. + + For example: + \code + #include + #include + #include + #include + \endcode + + \section2 Macros and Namespace + + QtMobility Sensors was built in a \c QtMobility namespace. This was enabled by + the use of various macros. Qt Sensors does not normally build into a namespace + and the macros from QtMobility no longer exist. + + \list + \li QTM_BEGIN_NAMESPACE + \li QTM_END_NAMESPACE + \li QTM_USE_NAMESPACE + \li QTM_PREPEND_NAMESPACE(x) + \endlist + + Note that Qt can be configured to build into a namespace. If Qt is built in this + way then Qt Sensors is also built into the nominated namespace. However, as this + is optional, the macros for this are typically defined to do nothing. + + \list + \li QT_BEGIN_NAMESPACE + \li QT_END_NAMESPACE + \li QT_USE_NAMESPACE + \li QT_PREPEND_NAMESPACE(x) + \endlist + + \section2 qtimestamp + + qtimestamp was previously defined as an opaque type equivalent to a quint64. It existed + as a class due to an implementation detail. + + In Qt Sensors, the API uses quint64 instead of qtimestamp. qtimestamp still exists as a + typedef so that applications that refer to qtimestamp can be compiled. + + \section1 Project Files + + QtMobility Sensors applications used this in their project files to enable the Sensors API. + + \code + CONFIG += mobility + MOBILITY += sensors + \endcode + + Applications should remove these lines and instead use this to enable the Qt Sensors API. + + \code + QT += sensors + \endcode +*/ + diff --git a/src/sensors/doc/src/qtmobilitysensors1.qdoc b/src/sensors/doc/src/qtmobilitysensors1.qdoc new file mode 100644 index 0000000..f9ba814 --- /dev/null +++ b/src/sensors/doc/src/qtmobilitysensors1.qdoc @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \qmlmodule QtMobility.sensors 1.3 + \title QtMobility.sensors 1.x + \brief Legacy QML import for QtSensors + + \section1 Overview + + This is the legacy QML import. It exists for compatibility with the QtMobiltiy 1.2 release + and is not recommended for new applications. + + See \l{Qt Sensors} for more information about the Sensors API. + + \section1 QML Module API + + See \l {Qt Sensors} for more information about the Sensors API. + + If the module is imported into a namespace, some additional methods become available. + + \code + import QtMobility.sensors 1.3 as Sensors + ... + Component.onCompleted: { + var types = Sensors.sensorTypes(); + console.log(types.join(", ")); + } + \endcode + + The documentation for the module API can be found in SensorGlobal. + + \section1 QML Sensor types + + These types represent specific types of sensors. + + Note that most properties come from the abstract \l{QtMobility.sensors1::Sensor}{Sensor} element. + + \annotatedlist qml-sensors_type + + \section1 QML Reading types + + The data from a sensor comes through a reading class. + + \annotatedlist qml-sensors_reading + + \section1 Alphabetical Listing of QML Types + +*/ + diff --git a/src/sensors/doc/src/qtsensorgestures-cpp.qdoc b/src/sensors/doc/src/qtsensorgestures-cpp.qdoc new file mode 100644 index 0000000..e78ce4d --- /dev/null +++ b/src/sensors/doc/src/qtsensorgestures-cpp.qdoc @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\page qtsensorgestures-cpp.html +\title Sensor Gestures C++ Overview +\brief Information about the QtSensorGestures C++ API + +\tableofcontents + +\section1 Using QtSensorGestures + +With the Sensor Gestures classes, you are able to easily utilize device gesturing using +sensors such as the accelerometer and proximity. + +A list of currently supported sensor gestures and their descriptions can be found here: +\l {Qt Sensor Gestures} + +Using QtSensorGestures is easy. There are two main classes you will need to use. + +QSensorGestureManager can be used for determining what sensor gestures are available, and +QSensorGesture for connecting the sensor gesture signals. + +\snippet sensorgestures/creating.cpp Receiving sensor gesture signals + +More information about the sensor gesture recognizers can be found in +\l{QtSensorGestures Plugins}. + +\section1 Main Classes + +The primary classes that make up the QtSensorGestures API. + +\annotatedlist sensorgestures_main + +*/ + diff --git a/src/sensors/doc/src/qtsensorgestures-emulator.qdoc b/src/sensors/doc/src/qtsensorgestures-emulator.qdoc new file mode 100644 index 0000000..af061e2 --- /dev/null +++ b/src/sensors/doc/src/qtsensorgestures-emulator.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $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. + +\section1 Developing sensor gesture clients. + +For instance, the Emulator can be used for writing a client app that needs +to use the 'slam' gesture. + +Under the 'Sensors' heading in the Emulator control, you will see an edit +box for 'Sensor gestures' that will contain a list of signals available +when your client instantiates a QSensorGesture. + +Select 'slam', and then click the 'Send' button +to send a detected("slam") signal to the client. + +*/ diff --git a/src/sensors/doc/src/qtsensorgestures-plugins.qdoc b/src/sensors/doc/src/qtsensorgestures-plugins.qdoc new file mode 100644 index 0000000..67734aa --- /dev/null +++ b/src/sensors/doc/src/qtsensorgestures-plugins.qdoc @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\group sensorgesture_plugins_topics +\title QtSensorGestures Plugins +\brief Information about the QtSensorGestures recognizer plugins. + +The QtSensorGestures recognizer plugins are the way to create your own +sensor gestures. + +Creating software to recognize motion gestures using sensors is a huge subject not covered here. + +The QSensorGesture API does not limit usage to any of the common classification methods of gesture +recognition such as Hidden Markov Models, Neural Networks, Dynamic Time Warping, or even the +ad-hoc heuristic recognizers of Qt's built-in sensor gesture recognizers. It's basically a +signaling system for lower level gesture recogition methods and algorithms to communicate to the +higher level applications. + +\tableofcontents + +\section1 Overview + + The steps to creating a sensor gesture plugin are as follows: +\list +\li Sub-class from QSensorGesturePluginInterface +\li Sub-class from QSensorGestureRecognizer and implement gesture recognizer logic using QtSensors. +\li Create an instance of that recognizer in the derived QSensorGesturePluginInterface class, and call + QSensorGestureManager::registerSensorGestureRecognizer(sRec); in your registerRecognizers() +function. QSensorGestureManager will retain ownership of the recognizer object. + +This is the class in which the gesture recognizer system should be implemented from. + +\endlist + +\snippet sensorgestures/plugin.cpp Plugin + + +\section2 Recognizer Classes + +If you are making sensorgestures available through the QtSensorGestures API, these are the +classes to subclass. + +\annotatedlist sensorgestures_recognizer + +\target Qt Sensor Gestures +\section3 Recognizer Plugins + +The Sensor Gesture Recognizers that come with Qt are made using an ad-hock heurustic approach. +The user cannot define their own gestures, and must learn how to perform and accomodate the +pre-defined gestures herein. + +A developer may use any method including computationally and training intensive well + known classifiers, to produce gesture recognizers. There are currently no classes in Qt for +gesture training, nor ability for the user to define their own sensor based motion gestures. + +A procedure for writing ad-hock recognizers might include: +\list + \li Obtain and gather output from the accelerometer through QAccelerometerReading of a gesture being performed. + \li Use various methods and constraints on the accelerometer data to recognize the various states: + \list i + \li Initial 'listening' state for a gesture + \li Start of a possible gesture, moving into a 'detecting' state + \li End of a possible gesture, moving into a 'recognizing' state + \li and finally, if it is recognized, the 'recognized' state, or if not recognized, move back to + the 'listening' state. + \endlist + \li Test procedure to make sure it is easy to perform, and will not + produce too many false positive recognitions. And if used with other gestures, collisions. Meaning +that gestures performed get recognized as another gesture instead. + +\endlist + +Here is a list of included plugins and their signals + +For ShakeGestures plugin: + \table + \row + \li Recognizer Id + \li Signals + \row + \li QtSensors.shake + \li shake +\endtable + +For QtSensorGestures plugin: + \table + \row + \li Recognizer Id + \li Signals + \li Description + \li Images + \row + \li QtSensors.cover + \li cover + \li Hand covers up phone display for one second, when it's face up, using the Proximity and Orientation sensors. + \li \image sensorgesture-cover.png + \row + \li QtSensors.doubletap + \li doubletap + \li Double tap of finger on phone, using the DoubleTap sensor. + \li \image sensorgesture-doubletap.png + \row + \li QtSensors.hover + \li hover + \li Hand hovers about 4 cm above the phone for more than 1 second, then is removed when face up, + using the IR Proximity sensor. + \li \image sensorgesture-hover.png + \row + \li QtSensors.pickup + \li pickup + \li Phone is resting face up on a flat curface, and is then picked up and brought up into viewing position, using the Accelerometer sensor. + \li \image sensorgesture-faceup.png + \row + \li QtSensors.shake2 + \li shakeLeft, shakeRight, shakeUp, shakeDown + \li Shake phone in a certain direction, using the Accelerometer sensor. + \li \image sensorgesture-shake.png + \row + \li QtSensors.slam + \li slam + \li Phone is held in a top up position with a side facing forward for a moment. Swing it quickly with a downward motion + like it is being used to point at something with the top corner. using the Accelerometer and Orientation sensors. + \li \image sensorgesture-slam_1.png + \image sensorgesture-slam_2.png + \row + \li QtSensors.turnover + \li turnover + \li Phone is turned face down and placed on a surface, using Proximity and Orientation sensors. + \li \image sensorgesture-facedown.png + \row + \li QtSensors.twist + \li twistLeft, twistRight + \li Phone is held face up and then twisted left or right (left side up or right side up) and back, using the Accelerometer and Orientation sensors. + \li \image sensorgesture-twist.png + \row + \li QtSensors.whip + \li whip + \li Move phone quickly down and then back up. using the Accelerometer and Orientation sensors. + \li \image sensorgesture-whip.png + \endtable + +*/ diff --git a/src/sensors/doc/src/qtsensors-backend.qdoc b/src/sensors/doc/src/qtsensors-backend.qdoc new file mode 100644 index 0000000..e26c05a --- /dev/null +++ b/src/sensors/doc/src/qtsensors-backend.qdoc @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\group sensors_backend_topics +\title Qt Sensors Backend +\brief Information about the Qt Sensors back end + +The Qt Sensors backend connects the Qt Sensors API to the platform services or hardware sensors. + +\tableofcontents + +\section1 Overview + +\section1 Backend API + +QSensor instances talk to a backend object. Backends are usually supplied +with the Qt Sensors library for a specific device although third party +backends may be used as well. A backend may talk +directly to hardware or it may talk to a system service. In some instances +it may even talk to another sensor. +An example of this is the orientation sensor backend that talks to an +accelerometer to determine the device orientation. + +\section1 Backend Classes +If you are making sensors available through the Sensors API, these are the +classes to use. +\annotatedlist sensors_backend + +\section1 Backend Topics + +\generatelist related + +*/ + +/*! +\page creating-a-sensor-plugin.html +\title Creating a sensor plugin +\ingroup sensors_backend_topics + +\section1 How a sensor plugin is loaded + +Since sensor backends are created on demand, the sensor plugin is loaded and asked +to register the sensor backends it handles. The plugin should implement +QSensorPluginInterface::registerSensors() and call QSensorManager::registerBackend() +to register available backends. Typically the plugin will also inherit from +QSensorBackendFactory and implement +QSensorBackendFactory::createBackend() in order to instantiate backends it has registered. + +The simplest plugin will have just once sensor backend although there is no reason +that multiple sensor backends cannot be in a plugin. + +An example follows. + +\snippet sensors/plugin.cpp Plugin + +*/ + +/*! +\page determining-the-default-sensor-for-a-type.html +\title Determining the default sensor for a type +\ingroup sensors_backend_topics + +\section1 Multiple sensors can exist for a type + +Sensors was designed so that multiple sensors could exist for a given type. Why? +Consider this example. + +The N900 has an accelerometer built-in. It also features bluetooth and can pair +with a gaming controller that features an accelerometer. To a developer writing +a game these two devices are conceptually the same type. + +\section1 Default sensor for a type + +To avoid the need to know (or check) what the default sensor for a type is, the system will +use the default sensor for a type. Most of the time this is what the app developer wants to +do. In cases where the app developer wants to select a specific sensor they must call the +QSensor::setIdentifier() method before they start the sensor so that the appropriate backend +is used. + +From a system perspective though, selecting which sensor should be the default gets tricky. +The sensors library uses the first registered identifier as the default. This means that the +order in which sensor backends are registered is important so the system will allow a config +file to determine the default instead. + +\section1 Sensors.conf + +The config file that determines the default sensor for a type is called Sensors.conf. If present, +it is located in /etc/xdg/Nokia. It has the standard formatting of an ini file. + +The settings live in the Default group and the general format is: +\code +type = identifier +\endcode + +An example Sensors.conf that ensures the N900 accelerometer is used as the default no matter the +order in which backends were registered is presented here. + +\code +[Default] +QAccelerometer = n900.accelerometer +\endcode + +If Sensors.conf specifies an identifier that is not registered then the system will fall back to +the first registered identifier as the default. + +Note that there is special case logic to prevent the generic plugin's backends from becoming the +default when another backend is registered for the same type. This logic means that a backend +identifier starting with \c{generic.} will only be the default if no other backends have been +registered for that type or if it is specified in \c{Sensors.conf}. + +*/ + +/*! +\page dynamic-sensor-backend-registration.html +\title Dynamic Sensor Backend Registration +\ingroup sensors_backend_topics + +\section1 Static Backend Registration + +Sensor backends are generally registered statically. The registration happens when the sensors +library is first used and the registration remains in effect while the program runs. + +\image sensors-static.png + +Statically registered backends may still exhibit some dynamic behaviour as the +QSensorBackendFactory is free to return 0 to indicate that a backend cannot be created. + +\section1 Dynamic Backend Registration + +While static registration is fine for most backends there are some situations where this is +problematic. + +The clearest example is backends that represent non-fixed hardware. As an example, lets consider +a game controller that is connected via Bluetooth. As there may be more than one game controller +in range of the phone, the program wants to record that a specific game controller should be used. +If the backend had been registered statically there would have been no unique information about +the controller. Instead, the registration is delayed until the controller is seen. + +\image sensors-dynamic.png + +\section1 Suggested Registration Policy + +A backend for fixed hardware should be registered immediately. Applications can see that the +sensor can be used. + +A backend for remote hardware should not be registered immediately. Applications can see that +the sensor cannot be used. When the remote hardware becomes available the backend should be +registered. Applications can see that the sensor is now available. + +If it is necessary to return 0 from a factory for a backend that was registered, the backend +should be unregistered. Applications can see that the sensor is no longer available. If the +factory can create the backend again it should be registered. Applications can see that the +sensor is available again. + +When the underlying hardware is no longer available, the backend should be deregistered. +Existing instances of the backend should report error states to the application but should +handle the situation gracefully. + +*/ diff --git a/src/sensors/doc/src/qtsensors-cpp.qdoc b/src/sensors/doc/src/qtsensors-cpp.qdoc new file mode 100644 index 0000000..2f60592 --- /dev/null +++ b/src/sensors/doc/src/qtsensors-cpp.qdoc @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\page qtsensors-cpp.html +\title Qt Sensors C++ Overview +\brief Information about the Qt Sensors C++ API + +\tableofcontents + +\section1 Sensor Types + +On a device there can be many types of sensors. Not all of the types that the Qt Sensors API +supports may be available. There may also be types available that are not defined in the +Qt Sensors 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, Qt Sensors uses the +\l{http://en.wikipedia.org/wiki/Cartesian_coordinate_system}{Right Hand Cartesian coordinate system}. + +\image sensors-coordinates.jpg + +To allow for measurements in all 6 directions, negative values are used. + +\image sensors-coordinates2.jpg + +Where rotation around an axis is used, the rotation shall be expressed as a Right Hand rotation. + +\image sensors-coordinates3.jpg + +In general, sensor data is oriented to the top of the device. If values are to be displayed on +the screen the values may need to be transformed so that they match the user interface orientation. A sensor +may define its data as being oriented to the UI. This will be noted in the documentation for the +sensor. + +\image sensors-sides2.jpg + +\section1 Using a Sensor + +The life cycle of a QSensor is typically: + +\list +\li Create an instance of QSensor or one of its sub-classes on the stack or heap. +\li Setup as required by the application. +\li Start receiving values. +\li Sensor data is used by the application. +\li Stop receiving values. +\endlist + +Here is an example of creating a sensor on the heap and on the stack. + +\snippet sensors/creating.cpp Creating a sensor + +\section1 Accessing sensor data in a generic fashion + +The preferred way to deal with sensor data is via the \l{Reading Classes}. +However, sometimes this may not be possible. For example, you may be deploying +an application to a device that has a new sensor type but no C++ header +describing the reading class is available. + +Thanks to Qt's property system you can still access the sensor data. You need to know +3 pieces of information in order to do this: + +\list +\li The sensor type. +\li The property name or index. +\li The property type or a comparable type. +\endlist + +For example, here is an example of how you can access a property of the accelerometer. +This code does not require any compile-time links to \l QAccelerometer or +\l QAccelerometerReading. + +\snippet sensors/start.cpp Starting a sensor + +You can discover all of this information at runtime too. The sensor_explorer example +shows you information about available sensors. + +\section1 Front end, back end + +The Qt Sensors API has a front end, for application developers to use and a back end, +where device implementors write code to access their hardware. As an application +developer you do not need to access the back end though it may be useful to understand +how it works. + +Commands from the application are delivered through QSensor and then down to the +device plugin. Data comes back through the QSensorReading class. + +\image sensors-overview.png + +More information about the back end can be found in \l{Qt Sensors Backend}. + +\section1 Main Classes + +The primary classes that make up the Qt Sensors API. + +\annotatedlist sensors_main + +\section1 Reading Classes + +The best way to access sensor data is via one of these classes. + +\annotatedlist sensors_reading + +\section1 Sensor Classes + +These classes provide convenience wrappers that reduce the need for casting. +Each of these classes represents a sensor type that the Qt Sensors API knows +about. Note that additional types may be made available at run-time. See +\l{Sensor Types} for more information. + +\annotatedlist sensors_type + +\section1 Filter Classes + +As with the sensor classes, these provide convenience wrappers that reduce +the need for casting. + +\annotatedlist sensors_filter + +*/ + diff --git a/src/sensors/doc/src/qtsensors.qdoc b/src/sensors/doc/src/qtsensors.qdoc new file mode 100644 index 0000000..6128673 --- /dev/null +++ b/src/sensors/doc/src/qtsensors.qdoc @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtsensors-index.html + \title Qt Sensors + \brief The Qt Sensors API provides access to sensors via QML and C++ interfaces. + \ingroup technology-apis + + The Qt Sensors API provides access to sensor hardware via QML and C++ interfaces. + The Qt Sensors API also provides motion gesture recognition API for devices. + + \section1 Information for Application Writers + + Applications can access Qt Sensors using QML or C++. + + \table + \row + \li \l {Qt Sensors QML Types}{QML Types} + \li Information about the Qt Sensors QML API + \row + \li \l {Qt Sensors C++ Classes}{C++ Classes} + \li Information about the Qt Sensors C++ API + \row + \li \l{Qt Sensors C++ Overview} + \li High-level information on how to use the C++ API. + \row + \li \l {Sensor Gestures C++ Overview} + \li High-level information specific to sensor gestures. + \row + \li \l {Qt Sensors Examples}{Examples} + \li Examples demonstrating use of the Qt Sensors APIs + \endtable + + \section1 Information for Backend Implementors + + \table + \row + \li \l {Qt Sensors Backend}{Backend} + \li Information about the Qt Sensors back end + \row + \li \l {Qt Sensors - Grue Sensor Example} + \li The Qt Sensors - Grue Sensor Example demonstrates creation of a sensor backend + \endtable + + \section1 Compatibility with QtMobility Sensors API + + Qt Sensors 5.0 (the initial release) is generally expected to be source compatible + with QtMobility Sensors 1.2. + + \table + \row + \li \l {Porting Applications from QtMobility Sensors to Qt Sensors}{Porting Guide} + \li Information about the steps needed to port applications to the Qt Sensors API. + \endtable + + \omit + \section1 Information for Qt SensorGestures API + + Qt SensorGestures provides a motion gesture recognition API for devices. + + \table + \row + \li \l {SensorGesture}{QML API} + \li Information about the Qt SensorGestures QML API + \row + \li \l {QtSensorGestures C++ API}{C++ API} + \li Information about the Qt SensorGestures C++ API + \endtable + + \section1 Information for Qt SensorGestures Recognizer Plugin Implementors. + + \table + \row + \li \l {QtSensorGestures Plugins}{Plugins} + \li Information about the Qt SensorGestures recognizer plugins. + \row + \li \l {QtSensorGestures Emulator}{Emulator} + \li Information about Qt SensorGestures use in the Emulator. + \endtable + \endomit + + \section1 Platform-specific Information + \table + \row + \li \l {Compatibility Map}{Compatibility Map} + \li Compatibility map of all supported platforms. + \row + \li \l {Generic Backend}{Generic Backend} + \li Information about the generic sensor backend. + \endtable +*/ + diff --git a/src/sensors/doc/src/qtsensors5.qdoc b/src/sensors/doc/src/qtsensors5.qdoc new file mode 100644 index 0000000..71b62da --- /dev/null +++ b/src/sensors/doc/src/qtsensors5.qdoc @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/*! + \module QtSensors + \title Qt Sensors C++ Classes + \ingroup modules + + \brief The QtSensors module provides classes for reading sensor data. + + 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. +*/ + +/*! + \qmlmodule QtSensors 5 + \title Qt Sensors QML Types + \ingroup qmlmodules + + \brief The QtSensors QML module provides types for reading sensor data. + + \section1 QML Module API + + If the module is imported into a namespace, some additional methods become available. + + \code + import QtSensors 5.0 as Sensors + ... + Component.onCompleted: { + var types = Sensors.sensorTypes(); + console.log(types.join(", ")); + } + \endcode + + The documentation for the module API can be found in SensorGlobal. + + \section1 QML Sensor types + + These types represent specific types of sensors. + + Note that most properties come from the abstract \l{QtSensors::Sensor}{Sensor} element. + + \annotatedlist qml-sensors_type + + \section1 QML Reading types + + The data from a sensor comes through a reading class. + + \annotatedlist qml-sensors_reading +*/ + diff --git a/src/sensors/doc/src/sensor-examples.qdoc b/src/sensors/doc/src/sensor-examples.qdoc new file mode 100644 index 0000000..d934c8a --- /dev/null +++ b/src/sensors/doc/src/sensor-examples.qdoc @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** 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. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \group qtsensors-examples + \title Qt Sensors Examples + \brief Examples for the Qt Sensors module + \ingroup all-examples + + These are the Qt Sensors examples. + + \generatelist related +*/ + + + diff --git a/src/sensors/gestures/qsensorgesturemanager.cpp b/src/sensors/gestures/qsensorgesturemanager.cpp index 897e72f..969347a 100644 --- a/src/sensors/gestures/qsensorgesturemanager.cpp +++ b/src/sensors/gestures/qsensorgesturemanager.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE Sensor Gesture plugins register their recognizers using the registerSensorGestureRecognizer() function. - \snippet snippets/sensorgestures/creating.cpp Receiving sensor gesture signals + \snippet sensorgestures/creating.cpp Receiving sensor gesture signals */ diff --git a/src/sensors/qlightsensor.cpp b/src/sensors/qlightsensor.cpp index 30bd1de..b712bb6 100644 --- a/src/sensors/qlightsensor.cpp +++ b/src/sensors/qlightsensor.cpp @@ -49,7 +49,7 @@ IMPLEMENT_READING(QLightReading) /*! \class QLightReading \ingroup sensors_reading - + \inmodule QtSensors \brief The QLightReading class represents one reading from the light sensor. diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp index 0e9fcea..81cb653 100644 --- a/src/sensors/qsensor.cpp +++ b/src/sensors/qsensor.cpp @@ -78,6 +78,7 @@ QT_BEGIN_NAMESPACE /*! \class qoutputrange \relates QSensor + \inmodule QtSensors \brief The qoutputrange class holds the specifics of an output range. The class is defined as a simple struct. @@ -507,7 +508,7 @@ void QSensor::setDataRate(int rate) Backends have to implement QSensorBackend::isFeatureSupported() to make this work. - \return whether or not the feature is supported if the backend is connected, or false if the backend is not connected. + Returns whether or not the feature is supported if the backend is connected, or false if the backend is not connected. \since 5.0 */ bool QSensor::isFeatureSupported(Feature feature) const diff --git a/src/sensors/qsensorbackend.cpp b/src/sensors/qsensorbackend.cpp index 4486554..304674e 100644 --- a/src/sensors/qsensorbackend.cpp +++ b/src/sensors/qsensorbackend.cpp @@ -77,7 +77,7 @@ QSensorBackend::~QSensorBackend() This is the backend side of QSensor::isFeatureSupported(). Reimplement this function if the backend supports one of the additional sensor features of QSensor::Feature. - \return whether the feature \a feature is supported by this backend. The default implementation returns false. + Returns whether the feature \a feature is supported by this backend. The default implementation returns false. \since 5.0 */ bool QSensorBackend::isFeatureSupported(QSensor::Feature feature) const diff --git a/src/sensors/sensors.pro b/src/sensors/sensors.pro index e0c6821..2cb3346 100644 --- a/src/sensors/sensors.pro +++ b/src/sensors/sensors.pro @@ -10,7 +10,7 @@ simulator { QT += simulator } -QMAKE_DOCS = $$PWD/../../doc/config/qtsensors.qdocconf +QMAKE_DOCS = $$PWD/doc/qtsensors.qdocconf load(qt_module) -- cgit v1.2.1