From eee2eee734b4aa735d35f6c53d79c06c1c76425a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Apr 2014 15:59:08 +0200 Subject: Change slashes depending on host in examples. Task-number: QTBUG-38224 Change-Id: I3c7a3d0b3a47696aeb2eee799ae119419ea60713 Reviewed-by: Oswald Buddenhagen --- examples/sensors/grue/import/import.pro | 2 +- examples/sensors/sensor_explorer/import/import.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro index 87e3c91b..08b312db 100644 --- a/examples/sensors/grue/import/import.pro +++ b/examples/sensors/grue/import/import.pro @@ -31,7 +31,7 @@ copyfile = $$PWD/qmldir copydest = $$DESTDIR # On Windows, use backslashes as directory separators -win32: { +equals(QMAKE_HOST.os, Windows) { copyfile ~= s,/,\\,g copydest ~= s,/,\\,g } diff --git a/examples/sensors/sensor_explorer/import/import.pro b/examples/sensors/sensor_explorer/import/import.pro index 196c373c..a5fe441f 100644 --- a/examples/sensors/sensor_explorer/import/import.pro +++ b/examples/sensors/sensor_explorer/import/import.pro @@ -31,7 +31,7 @@ copyfile = $$PWD/qmldir copydest = $$DESTDIR # On Windows, use backslashes as directory separators -win32: { +equals(QMAKE_HOST.os, Windows) { copyfile ~= s,/,\\,g copydest ~= s,/,\\,g } -- cgit v1.2.3 From 75487a011fb8b8de1e22c25425f024dfb97dc192 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 11 Apr 2014 12:08:08 +0200 Subject: accelbubble: avoid updating position if NaN. Invalid sensor data is NaN, and should be ignored. Change-Id: I6436bdd494b3d167121bd8ee80f81c031e60743e Reviewed-by: Alex Blasche --- examples/sensors/accelbubble/accelbubble.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml index 8f676dc9..033e66a4 100644 --- a/examples/sensors/accelbubble/accelbubble.qml +++ b/examples/sensors/accelbubble/accelbubble.qml @@ -69,6 +69,9 @@ ApplicationWindow { var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * .1) var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * .1) + if (isNaN(newX) || isNaN(newY)) + return; + if (newX < 0) newX = 0 -- cgit v1.2.3 From da27dc09c45a236744c482107a7d9f709069381c Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 11 Apr 2014 14:13:04 +0200 Subject: accelbubble: disable rotation on iOS Change-Id: Ia3f6bdd494b3d167121bd8ee80f81c031a81f45a Reviewed-by: Alex Blasche --- examples/sensors/accelbubble/Info.plist | 35 ++++++++++++++++++++++++++++ examples/sensors/accelbubble/accelbubble.pro | 7 ++++++ 2 files changed, 42 insertions(+) create mode 100644 examples/sensors/accelbubble/Info.plist diff --git a/examples/sensors/accelbubble/Info.plist b/examples/sensors/accelbubble/Info.plist new file mode 100644 index 00000000..82e9bff0 --- /dev/null +++ b/examples/sensors/accelbubble/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDisplayName + accelbubble + CFBundleExecutable + accelbubble + CFBundleGetInfoString + Created by Qt/QMake + CFBundleIdentifier + com.digia.accelbubble + CFBundleName + accelbubble + CFBundlePackageType + APPL + CFBundleResourceSpecification + ResourceRules.plist + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro index cdb6ab75..4204f15b 100644 --- a/examples/sensors/accelbubble/accelbubble.pro +++ b/examples/sensors/accelbubble/accelbubble.pro @@ -15,4 +15,11 @@ OTHER_FILES = \ target.path = $$[QT_INSTALL_EXAMPLES]/sensors/accelbubble INSTALLS += target +ios { +QMAKE_INFO_PLIST = Info.plist + +# manual plugin loading needed with older Qt +# QTPLUGIN += qsvg qtsensors_ios qtsensors_generic +} + ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android -- cgit v1.2.3 From 8a0da79f058b7ee7cdf4a198fdf088e8a43565fb Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 11 Apr 2014 14:35:14 +0200 Subject: ios: skip accelerometer, gyroscope and magnetomenter updates if NaN Change-Id: I7becfab81d56fc45ec7dc76333383503b8abccfe Reviewed-by: Alex Blasche Reviewed-by: Richard Moe Gustavsen --- src/plugins/sensors/ios/iosaccelerometer.mm | 3 +++ src/plugins/sensors/ios/iosgyroscope.mm | 3 +++ src/plugins/sensors/ios/iosmagnetometer.mm | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/plugins/sensors/ios/iosaccelerometer.mm b/src/plugins/sensors/ios/iosaccelerometer.mm index 5f9c0f16..ef215465 100644 --- a/src/plugins/sensors/ios/iosaccelerometer.mm +++ b/src/plugins/sensors/ios/iosaccelerometer.mm @@ -77,6 +77,9 @@ void IOSAccelerometer::timerEvent(QTimerEvent *) // Convert from NSTimeInterval to microseconds and G to m/s2, and flip axes: CMAccelerometerData *data = m_motionManager.accelerometerData; CMAcceleration acc = data.acceleration; + // skip update if NaN + if (acc.x != acc.x || acc.y != acc.y || acc.z != acc.z) + return; static const qreal G = 9.8066; m_reading.setTimestamp(quint64(data.timestamp * 1e6)); m_reading.setX(qreal(acc.x) * G * -1); diff --git a/src/plugins/sensors/ios/iosgyroscope.mm b/src/plugins/sensors/ios/iosgyroscope.mm index 8dfa3a4a..751786ef 100644 --- a/src/plugins/sensors/ios/iosgyroscope.mm +++ b/src/plugins/sensors/ios/iosgyroscope.mm @@ -75,6 +75,9 @@ void IOSGyroscope::timerEvent(QTimerEvent *) // Convert NSTimeInterval to microseconds and radians to degrees: CMGyroData *data = m_motionManager.gyroData; CMRotationRate rate = data.rotationRate; + // skip update if NaN + if (rate.x != rate.x || rate.y != rate.y || rate.z != rate.z) + return; m_reading.setTimestamp(quint64(data.timestamp * 1e6)); m_reading.setX((qreal(rate.x) / M_PI) * 180); m_reading.setY((qreal(rate.y) / M_PI) * 180); diff --git a/src/plugins/sensors/ios/iosmagnetometer.mm b/src/plugins/sensors/ios/iosmagnetometer.mm index 95f85ae1..3cd8b10e 100644 --- a/src/plugins/sensors/ios/iosmagnetometer.mm +++ b/src/plugins/sensors/ios/iosmagnetometer.mm @@ -91,6 +91,9 @@ void IOSMagnetometer::timerEvent(QTimerEvent *) CMDeviceMotion *deviceMotion = m_motionManager.deviceMotion; CMCalibratedMagneticField calibratedField = deviceMotion.magneticField; field = calibratedField.field; + // skip update if NaN + if (field.x != field.x || field.y != field.y || field.z != field.z) + return; m_reading.setTimestamp(quint64(deviceMotion.timestamp * 1e6)); switch (calibratedField.accuracy) { @@ -110,6 +113,9 @@ void IOSMagnetometer::timerEvent(QTimerEvent *) } else { CMMagnetometerData *data = m_motionManager.magnetometerData; field = data.magneticField; + // skip update if NaN + if (field.x != field.x || field.y != field.y || field.z != field.z) + return; m_reading.setTimestamp(quint64(data.timestamp * 1e6)); m_reading.setCalibrationLevel(1.0); } -- cgit v1.2.3 From 267a9f4c4ea5ecfd3e0bf1f0149401e7ba8d0c60 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 17 Apr 2014 17:28:09 +0200 Subject: Bump MODULE_VERSION to 5.3.1 Change-Id: I58301f1f05ca0276dbfc6ca0382cb047f036e76c Reviewed-by: Oswald Buddenhagen --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 16328b7d..00e3fcf4 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.3.0 +MODULE_VERSION = 5.3.1 -- cgit v1.2.3 From 43e7f32c776ceebe60416524510e70afa3c9a8d9 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 23 Apr 2014 13:39:46 +0200 Subject: Add QtSensor changelog for Qt 5.3.0 Change-Id: I34160176dec6525e908956959c0749a199e45a2b Reviewed-by: Sergio Ahumada Reviewed-by: Alex Blasche Reviewed-by: Andrew Inwood --- dist/changes-5.3.0 | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 dist/changes-5.3.0 diff --git a/dist/changes-5.3.0 b/dist/changes-5.3.0 new file mode 100644 index 00000000..4c6f0256 --- /dev/null +++ b/dist/changes-5.3.0 @@ -0,0 +1,67 @@ +Qt 5.3 introduces many new features and improvements as well as bugfixes +over the 5.2.x series. 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. + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + + - The general documentation has been improved. + - The Accelbubble example was adjusted to suppress dynamic user interface + rotation which avoids the rotation of the UI itself when running the + example. + + +**************************************************************************** +* Library * +**************************************************************************** + +QtSensors +------------- + + - Various fixes to plug-ins and examples to simplify usage when using + static linking. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Android +------- + + - QAccelerometer's accellerationMode implemented. + - Fixed deployment of examples to Android targets. + + +BlackBerry +---------- + + - QProximitySensor + * The close detection algorithm fixed on sensors whose output is not binary. + +iOS +--- + + - Improved handling of NaN across all sensor implementations. + +WinRT +----- + + - QtSensors has been ported to WinRT/Windows Phone + -- cgit v1.2.3 From 87b569ccc4df161e33d41f7a5f1f25eced6f65c3 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 2 Jun 2014 12:46:45 +0200 Subject: Android: don't crash if Gravity is not supported The QtSensors documentation says that if Gravity mode is not available, we should silently fall back to the default Combined mode. In addition, add null pointer checks in case we try to ask for non-existent sensors in the future. Task-number: QTBUG-39335 Change-Id: I6c18622d081db4e3a7d07c744bb0b746e3f5c6ff Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../android/jar/src/org/qtproject/qt5/android/sensors/QtSensors.java | 3 +++ src/plugins/sensors/android/src/androidaccelerometer.cpp | 3 +++ src/plugins/sensors/android/src/androidjnisensors.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/plugins/sensors/android/jar/src/org/qtproject/qt5/android/sensors/QtSensors.java b/src/plugins/sensors/android/jar/src/org/qtproject/qt5/android/sensors/QtSensors.java index 5507b07b..efd1ff6d 100644 --- a/src/plugins/sensors/android/jar/src/org/qtproject/qt5/android/sensors/QtSensors.java +++ b/src/plugins/sensors/android/jar/src/org/qtproject/qt5/android/sensors/QtSensors.java @@ -73,6 +73,9 @@ public class QtSensors implements SensorEventListener { try { Sensor s = m_sensorManager.getDefaultSensor(sensorType); + if (s == null) { + return null; + } return s.getName() + " " + s.getVendor() + " v" + s.getVersion(); } catch(Exception e) { e.printStackTrace(); diff --git a/src/plugins/sensors/android/src/androidaccelerometer.cpp b/src/plugins/sensors/android/src/androidaccelerometer.cpp index 76aa0278..74b3d6db 100644 --- a/src/plugins/sensors/android/src/androidaccelerometer.cpp +++ b/src/plugins/sensors/android/src/androidaccelerometer.cpp @@ -95,5 +95,8 @@ AndroidSensors::AndroidSensorType AndroidAccelerometer::modeToSensor(QAccelerome break; } + if (type != AndroidSensors::TYPE_ACCELEROMETER && !AndroidSensors::availableSensors().contains(type)) + type = AndroidSensors::TYPE_ACCELEROMETER; + return type; } diff --git a/src/plugins/sensors/android/src/androidjnisensors.cpp b/src/plugins/sensors/android/src/androidjnisensors.cpp index af39e0b6..87889a89 100644 --- a/src/plugins/sensors/android/src/androidjnisensors.cpp +++ b/src/plugins/sensors/android/src/androidjnisensors.cpp @@ -113,6 +113,8 @@ namespace AndroidSensors jstring jstr = static_cast(aenv.jniEnv->CallStaticObjectMethod(sensorsClass, getSensorDescriptionMethodId, jint(sensor))); + if (!jstr) + return QString(); const jchar *pstr = aenv.jniEnv->GetStringChars(jstr, 0); QString ret(reinterpret_cast(pstr), aenv.jniEnv->GetStringLength(jstr)); aenv.jniEnv->ReleaseStringChars(jstr, pstr); -- cgit v1.2.3