summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-22 06:41:31 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-22 06:41:37 +0200
commit4dfa95538ff15f59880c93675676ce609b365d89 (patch)
treee3b1aded9bca7fe5280da8865cddc1214303ea55
parenta28678b83ac3a5a7530026027e2c16a23379168a (diff)
parentc20fa3ee91cdef22f270fea7159b4a8a4eab4a50 (diff)
downloadqtsensors-4dfa95538ff15f59880c93675676ce609b365d89.tar.gz
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
-rw-r--r--dist/changes-5.12.424
-rw-r--r--dist/changes-5.13.024
-rw-r--r--src/imports/sensors/plugins.qmltypes29
-rw-r--r--src/imports/sensors/sensors.cpp11
-rw-r--r--src/plugins/sensors/android/androidaccelerometer.cpp12
-rw-r--r--src/plugins/sensors/android/sensormanager.cpp2
-rw-r--r--src/plugins/sensors/iio-sensor-proxy/main.cpp17
-rw-r--r--src/sensors/doc/qtsensors.qdocconf1
-rw-r--r--src/sensors/doc/src/qtsensors-cpp.qdoc2
-rw-r--r--src/sensors/qcompass.cpp2
10 files changed, 112 insertions, 12 deletions
diff --git a/dist/changes-5.12.4 b/dist/changes-5.12.4
new file mode 100644
index 0000000..46807db
--- /dev/null
+++ b/dist/changes-5.12.4
@@ -0,0 +1,24 @@
+Qt 5.12.4 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.3.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Android *
+****************************************************************************
+
+ - Rewrite Qt Android Sensors using NDK API.
diff --git a/dist/changes-5.13.0 b/dist/changes-5.13.0
new file mode 100644
index 0000000..cdea881
--- /dev/null
+++ b/dist/changes-5.13.0
@@ -0,0 +1,24 @@
+Qt 5.13 introduces many new features and improvements as well as bugfixes
+over the 5.12.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.13 series is binary compatible with the 5.12.x series.
+Applications compiled for 5.12 will continue to run with 5.13.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Android *
+****************************************************************************
+
+ - Rewrite Qt Android Sensors using NDK API.
+ - Raise minimal Android sdk version to v21
+
diff --git a/src/imports/sensors/plugins.qmltypes b/src/imports/sensors/plugins.qmltypes
index 80e1df3..b78e63c 100644
--- a/src/imports/sensors/plugins.qmltypes
+++ b/src/imports/sensors/plugins.qmltypes
@@ -129,6 +129,20 @@ Module {
Property { name: "calibrationLevel"; type: "double"; isReadonly: true }
}
Component {
+ name: "QmlDistanceReading"
+ prototype: "QmlSensorReading"
+ exports: ["QtSensors/DistanceReading 5.4"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "distance"; type: "double"; isReadonly: true }
+ }
+ Component {
+ name: "QmlDistanceSensor"
+ prototype: "QmlSensor"
+ exports: ["QtSensors/DistanceSensor 5.4"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "QmlGyroscope"
prototype: "QmlSensor"
exports: [
@@ -173,6 +187,21 @@ Module {
exportMetaObjectRevisions: [0, 0]
}
Component {
+ name: "QmlHumidityReading"
+ prototype: "QmlSensorReading"
+ exports: ["QtSensors/HumidityReading 5.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "relativeHumidity"; type: "double"; isReadonly: true }
+ Property { name: "absoluteHumidity"; type: "double"; isReadonly: true }
+ }
+ Component {
+ name: "QmlHumiditySensor"
+ prototype: "QmlSensor"
+ exports: ["QtSensors/HumiditySensor 5.9"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "QmlIRProximitySensor"
prototype: "QmlSensor"
exports: [
diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp
index fa4cb3c..ce80a45 100644
--- a/src/imports/sensors/sensors.cpp
+++ b/src/imports/sensors/sensors.cpp
@@ -46,6 +46,8 @@
#include <QtSensors/qambientlightsensor.h>
#include <QtSensors/qambienttemperaturesensor.h>
#include <QtSensors/qcompass.h>
+#include <QtSensors/qdistancesensor.h>
+#include <QtSensors/qhumiditysensor.h>
#include <QtSensors/qmagnetometer.h>
#include <QtSensors/qorientationsensor.h>
#include <QtSensors/qproximitysensor.h>
@@ -64,8 +66,10 @@
#include "qmlambientlightsensor.h"
#include "qmlambienttemperaturesensor.h"
#include "qmlcompass.h"
+#include "qmldistancesensor.h"
#include "qmlgyroscope.h"
#include "qmlholstersensor.h"
+#include "qmlhumiditysensor.h"
#include "qmlirproximitysensor.h"
#include "qmllightsensor.h"
#include "qmlmagnetometer.h"
@@ -217,11 +221,18 @@ public:
qmlRegisterType <QmlSensorGesture >(package, major, minor, "SensorGesture");
+ // Register the 5.4 interfaces
+ minor = 4;
+ qmlRegisterType <QmlDistanceSensor >(package, major, minor, "DistanceSensor");
+ qmlRegisterUncreatableType<QmlDistanceReading >(package, major, minor, "DistanceReading", QLatin1String("Cannot create DistanceReading"));
+
// Register the new 5.9 interfaces
// Implicitly registers 5.3 - 5.8 too
minor = 9;
qmlRegisterType <QmlLidSensor >(package, major, minor, "LidSensor");
qmlRegisterUncreatableType<QmlLidReading >(package, major, minor, "LidReading", QLatin1String("Cannot create LidReading"));
+ qmlRegisterType <QmlHumiditySensor >(package, major, minor, "HumiditySensor");
+ qmlRegisterUncreatableType<QmlHumidityReading >(package, major, minor, "HumidityReading", QLatin1String("Cannot create HumidityReading"));
// Register the latest Qt version as QML type version
qmlRegisterModule(package, QT_VERSION_MAJOR, QT_VERSION_MINOR);
diff --git a/src/plugins/sensors/android/androidaccelerometer.cpp b/src/plugins/sensors/android/androidaccelerometer.cpp
index c9f5141..f38e004 100644
--- a/src/plugins/sensors/android/androidaccelerometer.cpp
+++ b/src/plugins/sensors/android/androidaccelerometer.cpp
@@ -82,18 +82,24 @@ void AndroidAccelerometer::applyAccelerationMode(QAccelerometer::AccelerationMod
{
switch (accelerationMode) {
case QAccelerometer::Gravity:
- if (!(m_accelerationModes & Gravity))
+ if (!(m_accelerationModes & Gravity)) {
qWarning() << "Gravity sensor missing";
+ return;
+ }
setSensorType(ASENSOR_TYPE_GRAVITY);
break;
case QAccelerometer::User:
- if (!(m_accelerationModes & LinearAcceleration))
+ if (!(m_accelerationModes & LinearAcceleration)) {
qWarning() << "Linear acceleration sensor missing";
+ return;
+ }
setSensorType(ASENSOR_TYPE_LINEAR_ACCELERATION);
break;
case QAccelerometer::Combined:
- if (!(m_accelerationModes & Accelerometer))
+ if (!(m_accelerationModes & Accelerometer)) {
qWarning() << "Accelerometer sensor missing";
+ return;
+ }
setSensorType(ASENSOR_TYPE_ACCELEROMETER);
break;
}
diff --git a/src/plugins/sensors/android/sensormanager.cpp b/src/plugins/sensors/android/sensormanager.cpp
index 590f478..542e54c 100644
--- a/src/plugins/sensors/android/sensormanager.cpp
+++ b/src/plugins/sensors/android/sensormanager.cpp
@@ -73,7 +73,7 @@ ALooper *SensorManager::looper() const
static inline ASensorManager* androidManager()
{
#if __ANDROID_API__ >= 26
- retrun ASensorManager_getInstanceForPackage(QJNIObjectPrivate{QtAndroidPrivate::context()}
+ return ASensorManager_getInstanceForPackage(QJNIObjectPrivate{QtAndroidPrivate::context()}
.callObjectMethod("getPackageName", "()Ljava/lang/String;")
.toString().toUtf8().constData());
#else
diff --git a/src/plugins/sensors/iio-sensor-proxy/main.cpp b/src/plugins/sensors/iio-sensor-proxy/main.cpp
index 136dd40..580e2c4 100644
--- a/src/plugins/sensors/iio-sensor-proxy/main.cpp
+++ b/src/plugins/sensors/iio-sensor-proxy/main.cpp
@@ -46,6 +46,9 @@
#include <qsensorbackend.h>
#include <qsensormanager.h>
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusConnectionInterface>
+
#include <QtCore/QFile>
#include <QtCore/QDebug>
@@ -57,12 +60,14 @@ class IIOSensorProxySensorPlugin : public QObject, public QSensorPluginInterface
public:
void registerSensors() override
{
- if (!QSensorManager::isBackendRegistered(QOrientationSensor::type, IIOSensorProxyOrientationSensor::id))
- QSensorManager::registerBackend(QOrientationSensor::type, IIOSensorProxyOrientationSensor::id, this);
- if (!QSensorManager::isBackendRegistered(QLightSensor::type, IIOSensorProxyLightSensor::id))
- QSensorManager::registerBackend(QLightSensor::type, IIOSensorProxyLightSensor::id, this);
- if (!QSensorManager::isBackendRegistered(QCompass::type, IIOSensorProxyCompass::id))
- QSensorManager::registerBackend(QCompass::type, IIOSensorProxyCompass::id, this);
+ if (QDBusConnection::systemBus().interface()->isServiceRegistered("net.hadess.SensorProxy")) {
+ if (!QSensorManager::isBackendRegistered(QOrientationSensor::type, IIOSensorProxyOrientationSensor::id))
+ QSensorManager::registerBackend(QOrientationSensor::type, IIOSensorProxyOrientationSensor::id, this);
+ if (!QSensorManager::isBackendRegistered(QLightSensor::type, IIOSensorProxyLightSensor::id))
+ QSensorManager::registerBackend(QLightSensor::type, IIOSensorProxyLightSensor::id, this);
+ if (!QSensorManager::isBackendRegistered(QCompass::type, IIOSensorProxyCompass::id))
+ QSensorManager::registerBackend(QCompass::type, IIOSensorProxyCompass::id, this);
+ }
}
QSensorBackend *createBackend(QSensor *sensor) override
diff --git a/src/sensors/doc/qtsensors.qdocconf b/src/sensors/doc/qtsensors.qdocconf
index 8b9b95d..0845e70 100644
--- a/src/sensors/doc/qtsensors.qdocconf
+++ b/src/sensors/doc/qtsensors.qdocconf
@@ -1,5 +1,6 @@
include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/config/exampleurl-qtsensors.qdocconf)
project = QtSensors
description = Qt Sensors Reference Documentation
diff --git a/src/sensors/doc/src/qtsensors-cpp.qdoc b/src/sensors/doc/src/qtsensors-cpp.qdoc
index b0d2726..d732a0d 100644
--- a/src/sensors/doc/src/qtsensors-cpp.qdoc
+++ b/src/sensors/doc/src/qtsensors-cpp.qdoc
@@ -56,7 +56,7 @@ Where rotation around an axis is used, the rotation shall be expressed as a Righ
\image sensors-coordinates3.jpg
-In general, sensor data is oriented relative to \l QPlatformScreen::nativeOrientation,
+In general, sensor data is oriented relative to \l QScreen::nativeOrientation,
that is to the top of the device when the device is held in its natural orientation
(normally when the device logo appears the right side up). If values are to be
displayed on the screen, the values may need to be transformed so that they match
diff --git a/src/sensors/qcompass.cpp b/src/sensors/qcompass.cpp
index a24e08e..5bd2101 100644
--- a/src/sensors/qcompass.cpp
+++ b/src/sensors/qcompass.cpp
@@ -74,7 +74,7 @@ IMPLEMENT_READING(QCompassReading)
\brief the azimuth of the device.
Measured in degrees from magnetic north in a clockwise direction based on
- the top of the device, as defined by QPlatformScreen::nativeOrientation.
+ the top of the device, as defined by QScreen::nativeOrientation.
\sa {QCompassReading Units}
*/