diff options
-rw-r--r-- | dist/changes-5.12.4 | 24 | ||||
-rw-r--r-- | dist/changes-5.13.0 | 24 | ||||
-rw-r--r-- | src/imports/sensors/plugins.qmltypes | 29 | ||||
-rw-r--r-- | src/imports/sensors/sensors.cpp | 11 | ||||
-rw-r--r-- | src/plugins/sensors/android/androidaccelerometer.cpp | 12 | ||||
-rw-r--r-- | src/plugins/sensors/android/sensormanager.cpp | 2 | ||||
-rw-r--r-- | src/plugins/sensors/iio-sensor-proxy/main.cpp | 17 | ||||
-rw-r--r-- | src/sensors/doc/qtsensors.qdocconf | 1 | ||||
-rw-r--r-- | src/sensors/doc/src/qtsensors-cpp.qdoc | 2 | ||||
-rw-r--r-- | src/sensors/qcompass.cpp | 2 |
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 00000000..46807dbe --- /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 00000000..cdea8819 --- /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 80e1df36..b78e63c6 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 fa4cb3c2..ce80a45c 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 c9f5141e..f38e0047 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 590f478c..542e54c9 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 136dd40e..580e2c46 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 8b9b95d0..0845e707 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 b0d2726f..d732a0dd 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 a24e08e2..5bd2101b 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} */ |