diff options
23 files changed, 176 insertions, 680 deletions
@@ -81,7 +81,6 @@ doc/src/snippets/sensors/sensorsdocsnippet # Generated example binaries examples/sensors/accel/accel examples/sensors/accelbubble/accelbubble -examples/sensors/cubehouse/cubehouse examples/sensors/grue/console_app/detect_grue examples/sensors/grue/grue examples/sensors/grue/lib/*gruesensor* diff --git a/dist/changes-5.3.1 b/dist/changes-5.3.1 new file mode 100644 index 0000000..e1e8dfc --- /dev/null +++ b/dist/changes-5.3.1 @@ -0,0 +1,44 @@ +Qt 5.3.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.3.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.3 + +The Qt version 5.3 series is binary compatible with the 5.2.x series. +Applications compiled for 5.2 will continue to run with 5.3. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Library * +**************************************************************************** + +QtSensors +--------- + + - [QTBUG-38224] Fixed usage of wrong directory separator by some sensor + examples. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Android +------- + + - [QTBUG-39335] Fixed crash when accelerationMode was set to Gravity + +Windows +------- + + - [QTBUG-39698] Fixed crash when trying to access the sensors on a desktop + rather than mobile platforms. + diff --git a/dist/changes-5.3.2 b/dist/changes-5.3.2 new file mode 100644 index 0000000..17f6d71 --- /dev/null +++ b/dist/changes-5.3.2 @@ -0,0 +1,41 @@ +Qt 5.3.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.3.0 and Qt 5.3.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.3 + +The Qt version 5.3 series is binary compatible with the 5.2.x series. +Applications compiled for 5.2 will continue to run with 5.3. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Library * +**************************************************************************** + +QtSensors +--------- + + - QCompass documentation improved. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Linux +----- + + - [sensorfw] Fixed incomplete initialization after restarting sensord. + - [sensorfw] Improved debugging and tracing capabilities + - [sensorfw] Added more checks to be more tolerant in case of errors or + corner cases. + - [sensorfw] Minor code cleanups + diff --git a/examples/sensors/cubehouse/Cube.qml b/examples/sensors/cubehouse/Cube.qml deleted file mode 100644 index 4d74cc2..0000000 --- a/examples/sensors/cubehouse/Cube.qml +++ /dev/null @@ -1,81 +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$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 - -Cube { - objectName: "cube" - - transform: [ - Rotation3D { - angle: 45.0 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: 45.0 - axis: Qt.vector3d(0, 0, 1) - }, - Rotation3D { - id: yRT - angle: 0 - axis: Qt.vector3d(0, -1, 0) - } - ] - - SequentialAnimation { - running: true - loops: Animation.Infinite - NumberAnimation { - target: yRT - property: "angle" - from: 0 - to: 360 - duration: 1000 - } - } - - effect: Effect { - color: "#aaca00" - texture: "content/qtlogo.png" - decal: true - } -} diff --git a/examples/sensors/cubehouse/Room.qml b/examples/sensors/cubehouse/Room.qml deleted file mode 100644 index c15c9ee..0000000 --- a/examples/sensors/cubehouse/Room.qml +++ /dev/null @@ -1,288 +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$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 -import "." - -Item3D{ - id: room - property double scale: 1.0 - property bool yspin: false - property bool xspin: false - property int yrot: 0 - property int xrot: 0 - property double distanceCorrection: 3.7 - - transform: [ - Rotation3D { - id: yRT - angle: 0 - axis: Qt.vector3d(0, -1, 0) - }, - Rotation3D { - id: xRT - angle: 0 - axis: Qt.vector3d(-1, 0, 0) - } - ] - - SequentialAnimation { - running: yspin - NumberAnimation { - target: yRT - property: "angle" - to: yrot - easing.type:"Linear" - duration: 50 - } - onCompleted: yspin = false - } - - SequentialAnimation { - running: xspin - NumberAnimation { - target: xRT - property: "angle" - to: xrot - easing.type:"Linear" - duration: 50 - } - onCompleted: xspin = false - } - - function rotateY(y) - { - room.yrot=y; - room.yspin = true; - } - - function rotateX(x) - { - room.xrot=x; - room.xspin = true; - } - - Quad { - id: frontWall - scale: room.scale - effect: Effect { - texture: "content/wall.jpg" - } - transform: [ - Translation3D { - translate: Qt.vector3d(0, -frontWall.scale + room.distanceCorrection, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: 0 - axis: Qt.vector3d(0, 1, 0) - }, - Rotation3D { - angle: 0 - axis: Qt.vector3d(0, 0, 1) - } - ] - } - - Quad { - id: ground - scale: room.scale - effect: Effect { - texture: "content/ground.jpg" - } - transform: [ - Translation3D { - translate: Qt.vector3d(0, -ground.scale + room.distanceCorrection, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 1, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 0, 1) - } - ] - } - - Quad { - id: leftWall - scale: room.scale - effect: Effect { - texture: "content/wall.jpg" - } - transform: [ - Translation3D { - translate: Qt.vector3d(0, -leftWall.scale + room.distanceCorrection, 0) - }, - Rotation3D { - angle: 0 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 1, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 0, 1) - } - ] - } - - Quad { - id: rightWall - scale: room.scale - effect: Effect { - texture: "content/wall.jpg" - } - transform: [ - Translation3D { - translate: Qt.vector3d(0, -rightWall.scale + room.distanceCorrection, 0) - }, - Rotation3D { - angle: 180 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 1, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 0, 1) - } - ] - } - - Quad { - id: roof - scale: room.scale - effect: Effect { - texture: "content/roof.jpg" - } - transform: [ - Translation3D { - translate: Qt.vector3d(0, -roof.scale + room.distanceCorrection, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: -90 - axis: Qt.vector3d(0, 1, 0) - }, - Rotation3D { - angle: 90 - axis: Qt.vector3d(0, 0, 1) - } - ] - } - - Quad { - id: backWall - scale: room.scale - effect: Effect { - texture: "content/wall.jpg" - } - transform: [ - Translation3D { - translate: Qt.vector3d(0, -backWall.scale + room.distanceCorrection, 0) - }, - Rotation3D { - angle: -90 - axis: Qt.vector3d(1, 0, 0) - }, - Rotation3D { - angle: 0 - axis: Qt.vector3d(0, 1, 0) - }, - Rotation3D { - angle: 0 - axis: Qt.vector3d(0, 0, 1) - } - ] - } - - Cube { - id: cube - scale: 0.5 - - transform: [ - Translation3D { - translate: Qt.vector3d(0.0, 0.0, 0.0) - } - ] - } - - Table { - scale: 0.025 - transform: [ - Translation3D { - translate: Qt.vector3d(0, -7 + room.distanceCorrection, 0) - } - ] - } - - Teapot { - scale: 0.5 - - effect: Effect { - color: "#ffffaa" - decal: true - } - - transform: [ - Translation3D { - translate: Qt.vector3d(0.0, -4.50 + room.distanceCorrection, 0.0) - } - ] - } -} diff --git a/examples/sensors/cubehouse/Table.qml b/examples/sensors/cubehouse/Table.qml deleted file mode 100644 index 61c474c..0000000 --- a/examples/sensors/cubehouse/Table.qml +++ /dev/null @@ -1,50 +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$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 -import "." - -Item3D { - id: table - scale: 1 - mesh: Mesh { source: "mesh/table.3ds" } -} diff --git a/examples/sensors/cubehouse/content/ground.jpg b/examples/sensors/cubehouse/content/ground.jpg Binary files differdeleted file mode 100644 index 2664b99..0000000 --- a/examples/sensors/cubehouse/content/ground.jpg +++ /dev/null diff --git a/examples/sensors/cubehouse/content/qtlogo.png b/examples/sensors/cubehouse/content/qtlogo.png Binary files differdeleted file mode 100644 index 7d3e97e..0000000 --- a/examples/sensors/cubehouse/content/qtlogo.png +++ /dev/null diff --git a/examples/sensors/cubehouse/content/roof.jpg b/examples/sensors/cubehouse/content/roof.jpg Binary files differdeleted file mode 100644 index 53a35d6..0000000 --- a/examples/sensors/cubehouse/content/roof.jpg +++ /dev/null diff --git a/examples/sensors/cubehouse/content/wall.jpg b/examples/sensors/cubehouse/content/wall.jpg Binary files differdeleted file mode 100644 index 7c56e23..0000000 --- a/examples/sensors/cubehouse/content/wall.jpg +++ /dev/null diff --git a/examples/sensors/cubehouse/cubehouse.pro b/examples/sensors/cubehouse/cubehouse.pro deleted file mode 100644 index 18191d3..0000000 --- a/examples/sensors/cubehouse/cubehouse.pro +++ /dev/null @@ -1,15 +0,0 @@ -TEMPLATE = app -TARGET = cubehouse -QT += quick -SOURCES = main.cpp - -OTHER_FILES = \ - $$files(*.qml) \ - content \ - mesh - -target.path = $$[QT_INSTALL_EXAMPLES]/sensors/cubehouse -INSTALLS += target - -RESOURCES += \ - cubehouse.qrc diff --git a/examples/sensors/cubehouse/cubehouse.qml b/examples/sensors/cubehouse/cubehouse.qml deleted file mode 100644 index ee2774a..0000000 --- a/examples/sensors/cubehouse/cubehouse.qml +++ /dev/null @@ -1,113 +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$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 - -//! [0] -import QtSensors 5.0 -//! [0] - -import "." - -Item { - id: mainWindow - width: 320 - height: 480 - - Viewport { - id: view - anchors.top: parent.top - width: parent.width - height: parent.height - fillColor: "darkblue" - objectName: "cube viewport" - camera: Camera { eye: Qt.vector3d(0, 3, 1.6 * room.scale - 4)} - - Room{ - id: room - scale: 7.0 - } - - function rotateY(y) - { - room.rotateY(y); - } - - function rotateX(x) - { - room.rotateX(x); - } - } - -//! [1] - Accelerometer { - id: accel - active: true - dataRate: 20 -//! [1] - -//! [2] - property double pitch: 0.0 - property double roll: 0.0 -//! [2] - -//! [3] - onReadingChanged: { - pitch = -(Math.atan2(reading.x, Math.sqrt(reading.y * reading.y + reading.z * reading.z)) * 180) / Math.PI; - roll = (Math.atan2(reading.y, Math.sqrt(reading.x * reading.x + reading.z * reading.z)) * 180) / Math.PI; - } - } -//! [3] - - - //Timer to read out the x and y rotation of the TiltSensor -//! [4] - Timer { - interval: 50; running: true; repeat: true - - onTriggered: { - view.rotateY(accel.pitch); - view.rotateX(accel.roll); - } - } -//! [4] -} diff --git a/examples/sensors/cubehouse/cubehouse.qrc b/examples/sensors/cubehouse/cubehouse.qrc deleted file mode 100644 index 144151b..0000000 --- a/examples/sensors/cubehouse/cubehouse.qrc +++ /dev/null @@ -1,13 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>Cube.qml</file> - <file>cubehouse.qml</file> - <file>Room.qml</file> - <file>Table.qml</file> - <file>content/ground.jpg</file> - <file>content/wall.jpg</file> - <file>content/roof.jpg</file> - <file>content/qtlogo.png</file> - <file>mesh/table.3ds</file> - </qresource> -</RCC> diff --git a/examples/sensors/cubehouse/doc/src/cubehouse.qdoc b/examples/sensors/cubehouse/doc/src/cubehouse.qdoc deleted file mode 100644 index e286e32..0000000 --- a/examples/sensors/cubehouse/doc/src/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 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/cubehouse/main.cpp b/examples/sensors/cubehouse/main.cpp deleted file mode 100644 index 95d169f..0000000 --- a/examples/sensors/cubehouse/main.cpp +++ /dev/null @@ -1,42 +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 "../stub.h" -SENSORS_EXAMPLE_MAIN(cubehouse) diff --git a/examples/sensors/cubehouse/mesh/table.3ds b/examples/sensors/cubehouse/mesh/table.3ds Binary files differdeleted file mode 100644 index 3e576bd..0000000 --- a/examples/sensors/cubehouse/mesh/table.3ds +++ /dev/null diff --git a/examples/sensors/maze/android/AndroidManifest.xml b/examples/sensors/maze/android/AndroidManifest.xml new file mode 100644 index 0000000..de787fa --- /dev/null +++ b/examples/sensors/maze/android/AndroidManifest.xml @@ -0,0 +1,56 @@ +<?xml version="1.0"?> +<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> + <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --"> + <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTop"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> + <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> + <meta-data android:name="android.app.repository" android:value="default"/> + <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> + <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> + <!-- Deploy Qt libs as part of package --> + <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> + <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> + <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> + <!-- Run with local libs --> + <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> + <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> + <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> + <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> + <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> + <!-- Messages maps --> + <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/> + <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/> + <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> + <!-- Messages maps --> + + <!-- Splash screen --> + <!-- + <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> + --> + <!-- Splash screen --> + + <!-- Background running --> + <!-- Warning: changing this value to true may cause unexpected crashes if the + application still try to draw after + "applicationStateChanged(Qt::ApplicationSuspended)" + signal is sent! --> + <meta-data android:name="android.app.background_running" android:value="false"/> + <!-- Background running --> + </activity> + </application> + <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/> + <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> + + <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. + Remove the comment if you do not require these default permissions. --> + <!-- %%INSERT_PERMISSIONS --> + + <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. + Remove the comment if you do not require these default features. --> + <!-- %%INSERT_FEATURES --> + +</manifest> diff --git a/examples/sensors/maze/maze.pro b/examples/sensors/maze/maze.pro index e4c4d86..f15fa57 100644 --- a/examples/sensors/maze/maze.pro +++ b/examples/sensors/maze/maze.pro @@ -1,16 +1,19 @@ TEMPLATE = app TARGET = maze -QT += quick +QT += quick sensors SOURCES = main.cpp OTHER_FILES = \ components \ $$files(*.qml) \ $$files(*.js) \ - content + content \ + android/AndroidManifest.xml target.path = $$[QT_INSTALL_EXAMPLES]/sensors/maze INSTALLS += target RESOURCES += \ maze.qrc + +ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android diff --git a/examples/sensors/maze/maze.qml b/examples/sensors/maze/maze.qml index eeaea28..19174a4 100644 --- a/examples/sensors/maze/maze.qml +++ b/examples/sensors/maze/maze.qml @@ -75,7 +75,6 @@ import "components" //! [0] import QtSensors 5.0 //! [0] -import QtSystemInfo 5.0 //Import the javascript functions for this game import "lib.js" as Lib @@ -86,7 +85,6 @@ ApplicationWindow { property Mouse mouseCtrl; property LabyrinthSquare cheeseSquare; property Congratulation congratulation; - ScreenSaver { screenSaverEnabled: !tiltTimer.running } Rectangle { id: gameRect @@ -171,9 +169,9 @@ ApplicationWindow { } //! [1] - TiltSensor{ + TiltSensor { id: tiltSensor - enabled: true + active: true } //! [1] @@ -185,7 +183,7 @@ ApplicationWindow { //! [2] onTriggered: { if (!tiltSensor.enabled) - tiltSensor.enabled = true; + tiltSensor.active = true; //! [2] if (mouseCtrl === null) diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro index 6b994b8..953071c 100644 --- a/examples/sensors/sensors.pro +++ b/examples/sensors/sensors.pro @@ -4,6 +4,7 @@ SUBDIRS += grue qtHaveModule(quick) { SUBDIRS += \ + maze \ qmlsensorgestures \ qmlqtsensors \ sensor_explorer \ @@ -16,10 +17,4 @@ qtHaveModule(quick) { qtHaveModule(widgets): SUBDIRS += \ sensorgestures -qtHaveModule(3d): SUBDIRS += \ - cubehouse - -qtHaveModule(systeminfo): SUBDIRS += \ - maze - OTHER_FILES = stub.h diff --git a/src/sensors/gestures/qsensorgesturemanagerprivate_p.h b/src/sensors/gestures/qsensorgesturemanagerprivate_p.h index fefabd5..abcadd3 100644 --- a/src/sensors/gestures/qsensorgesturemanagerprivate_p.h +++ b/src/sensors/gestures/qsensorgesturemanagerprivate_p.h @@ -34,6 +34,17 @@ #ifndef QSENSORGESTUREMANAGERPRIVATE_P_H #define QSENSORGESTUREMANAGERPRIVATE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QMap> #include <QStringList> diff --git a/src/sensors/qsensormanager.cpp b/src/sensors/qsensormanager.cpp index b646d61..b896359 100644 --- a/src/sensors/qsensormanager.cpp +++ b/src/sensors/qsensormanager.cpp @@ -97,7 +97,7 @@ public: #endif qCDebug(sensorsCategory) << "Loading config from" << config; if (!QFile::exists(config)) { - qCWarning(sensorsCategory) << "There is no config file" << config; + qCDebug(sensorsCategory) << "There is no config file" << config; return; } QFile cfgfile(config); @@ -168,7 +168,7 @@ public Q_SLOTS: Q_GLOBAL_STATIC(QSensorManagerPrivate, sensorManagerPrivate) -static void initPlugin(QObject *o) +static void initPlugin(QObject *o, bool warnOnFail = true) { qCDebug(sensorsCategory) << "Init plugin" << o; if (!o) { @@ -194,7 +194,7 @@ static void initPlugin(QObject *o) qCDebug(sensorsCategory) << "Register sensors for " << plugin; d->seenPlugins.insert(o); plugin->registerSensors(); - } else { + } else if (warnOnFail) { qCWarning(sensorsCategory) << "Can't cast to plugin" << o; } } @@ -208,7 +208,7 @@ void QSensorManagerPrivate::loadPlugins() SENSORLOG() << "initializing static plugins"; // Qt-style static plugins Q_FOREACH (QObject *plugin, QPluginLoader::staticInstances()) { - initPlugin(plugin); + initPlugin(plugin, false/*do not warn on fail*/); } if (d->loadExternalPlugins) { diff --git a/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h b/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h index d7e5842..cca9a6a 100644 --- a/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h +++ b/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h @@ -34,6 +34,17 @@ #ifndef QTESTSENSORGESTUREPLUGIN_P_H #define QTESTSENSORGESTUREPLUGIN_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <qsensorgestureplugininterface.h> |