From 2494c271d49f30e783cba20dd430b64bb9261702 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 3 Dec 2015 08:29:20 +0100 Subject: Fixed qmlqtsensors example There were API changes, that broke the current version. Both the tilt sensor's value and the ambient light sensor's enum value are now part of the reading's instead of the sensor's API. Change-Id: I774ecbcacdcce537358fdb0f3a6794a89572742d Reviewed-by: Alex Blasche --- examples/sensors/qmlqtsensors/qmlqtsensors.qml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qml b/examples/sensors/qmlqtsensors/qmlqtsensors.qml index bc456be..40492c7 100644 --- a/examples/sensors/qmlqtsensors/qmlqtsensors.qml +++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qml @@ -106,18 +106,18 @@ ApplicationWindow { active: false //! [5] onReadingChanged: { - if (reading.lightLevel == AmbientLightSensor.Unknown) - ambientlighttext.text = "Ambient light: Unknown"; - else if (reading.lightLevel == AmbientLightSensor.Dark) + if (reading.lightLevel == AmbientLightReading.Dark) ambientlighttext.text = "Ambient light: Dark"; - else if (reading.lightLevel == AmbientLightSensor.Twilight) + else if (reading.lightLevel == AmbientLightReading.Twilight) ambientlighttext.text = "Ambient light: Twilight"; - else if (reading.lightLevel == AmbientLightSensor.Light) + else if (reading.lightLevel == AmbientLightReading.Light) ambientlighttext.text = "Ambient light: Light"; - else if (reading.lightLevel == AmbientLightSensor.Bright) + else if (reading.lightLevel == AmbientLightReading.Bright) ambientlighttext.text = "Ambient light: Bright"; - else if (reading.lightLevel == AmbientLightSensor.Sunny) + else if (reading.lightLevel == AmbientLightReading.Sunny) ambientlighttext.text = "Ambient light: Sunny"; + else + ambientlighttext.text = "Ambient light: Unknown"; } //! [5] } @@ -160,7 +160,7 @@ ApplicationWindow { height: 30 verticalAlignment: Text.AlignVCenter //! [3] - text: "X Rotation: " + tilt.xRotation + "°" + text: "X Rotation: " + (tilt.reading ? tilt.reading.xRotation.toFixed(2) + "°" : "Unknown") //! [3] } } @@ -184,7 +184,7 @@ ApplicationWindow { height: 30 verticalAlignment: Text.AlignVCenter //! [4] - text: "Y Rotation: " + tilt.yRotation + "°" + text: "Y Rotation: " + (tilt.reading ? tilt.reading.yRotation.toFixed(2) + "°" : "Unknown") //! [4] } } -- cgit v1.2.1 From 13fd3e9611391742b4bea86cb2f4740534daf695 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 2 Dec 2015 13:17:30 +0100 Subject: winrt: Fix application hang on sensor start/stop If addition and removal are not done in the Xaml thread, the functions might not return at all. Task-number: QTBUG-49741 Change-Id: Iabdea2c7ee18bf851ab70adfeb28b09781b8b609 Reviewed-by: Andrew Knight Reviewed-by: Maurice Kalinowski --- src/plugins/sensors/winrt/winrt.pro | 2 +- src/plugins/sensors/winrt/winrtaccelerometer.cpp | 42 ++++++++++++-------- .../sensors/winrt/winrtambientlightsensor.cpp | 42 ++++++++++++-------- src/plugins/sensors/winrt/winrtcompass.cpp | 45 +++++++++++++--------- src/plugins/sensors/winrt/winrtgyroscope.cpp | 42 ++++++++++++-------- .../sensors/winrt/winrtorientationsensor.cpp | 42 ++++++++++++-------- src/plugins/sensors/winrt/winrtrotationsensor.cpp | 42 ++++++++++++-------- 7 files changed, 156 insertions(+), 101 deletions(-) diff --git a/src/plugins/sensors/winrt/winrt.pro b/src/plugins/sensors/winrt/winrt.pro index 4a03bf2..67ae530 100644 --- a/src/plugins/sensors/winrt/winrt.pro +++ b/src/plugins/sensors/winrt/winrt.pro @@ -1,5 +1,5 @@ TARGET = qtsensors_winrt -QT = sensors core +QT = sensors core core_private PLUGIN_TYPE = sensors PLUGIN_CLASS_NAME = WinRtSensorPlugin diff --git a/src/plugins/sensors/winrt/winrtaccelerometer.cpp b/src/plugins/sensors/winrt/winrtaccelerometer.cpp index f2728a8..fba9594 100644 --- a/src/plugins/sensors/winrt/winrtaccelerometer.cpp +++ b/src/plugins/sensors/winrt/winrtaccelerometer.cpp @@ -38,7 +38,9 @@ #include "winrtcommon.h" #include +#include +#include #include #include using namespace Microsoft::WRL; @@ -114,20 +116,24 @@ WinRtAccelerometer::WinRtAccelerometer(QSensor *sensor) : QSensorBackend(sensor), d_ptr(new WinRtAccelerometerPrivate(this)) { Q_D(WinRtAccelerometer); - HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Accelerometer); - ComPtr factory; - HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to initialize accelerometer factory." - << qt_error_string(hr); - sensorError(hr); - return; - } + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Accelerometer); + ComPtr factory; + HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to initialize accelerometer factory." + << qt_error_string(hr); + return hr; + } - hr = factory->GetDefault(&d->sensor); + hr = factory->GetDefault(&d->sensor); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to get default accelerometer." + << qt_error_string(hr); + } + return hr; + }); if (FAILED(hr) || !d->sensor) { - qCWarning(lcWinRtSensors) << "Unable to get default accelerometer." - << qt_error_string(hr); sensorError(hr); return; } @@ -158,9 +164,11 @@ void WinRtAccelerometer::start() if (d->token.value) return; - ComPtr callback = + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + ComPtr callback = Callback(d, &WinRtAccelerometerPrivate::readingChanged); - HRESULT hr = d->sensor->add_ReadingChanged(callback.Get(), &d->token); + return d->sensor->add_ReadingChanged(callback.Get(), &d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to attach to reading changed event." << qt_error_string(hr); @@ -189,14 +197,16 @@ void WinRtAccelerometer::stop() if (!d->token.value) return; - HRESULT hr = d->sensor->remove_ReadingChanged(d->token); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + return d->sensor->remove_ReadingChanged(d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to detach from reading changed event." << qt_error_string(hr); sensorError(hr); return; } - d->sensor->put_ReportInterval(0); + hr = d->sensor->put_ReportInterval(0); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to reset report interval." << qt_error_string(hr); diff --git a/src/plugins/sensors/winrt/winrtambientlightsensor.cpp b/src/plugins/sensors/winrt/winrtambientlightsensor.cpp index b1e1c52..d0d7fd7 100644 --- a/src/plugins/sensors/winrt/winrtambientlightsensor.cpp +++ b/src/plugins/sensors/winrt/winrtambientlightsensor.cpp @@ -38,7 +38,9 @@ #include "winrtcommon.h" #include +#include +#include #include #include using namespace Microsoft::WRL; @@ -113,20 +115,24 @@ WinRtAmbientLightSensor::WinRtAmbientLightSensor(QSensor *sensor) : QSensorBackend(sensor), d_ptr(new WinRtAmbientLightSensorPrivate(this)) { Q_D(WinRtAmbientLightSensor); - HStringReference classId(RuntimeClass_Windows_Devices_Sensors_LightSensor); - ComPtr factory; - HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to initialize light sensor factory." - << qt_error_string(hr); - sensorError(hr); - return; - } + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + HStringReference classId(RuntimeClass_Windows_Devices_Sensors_LightSensor); + ComPtr factory; + HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to initialize light sensor factory." + << qt_error_string(hr); + return hr; + } - hr = factory->GetDefault(&d->sensor); + hr = factory->GetDefault(&d->sensor); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to get default light sensor." + << qt_error_string(hr); + } + return hr; + }); if (FAILED(hr) || !d->sensor) { - qCWarning(lcWinRtSensors) << "Unable to get default light sensor." - << qt_error_string(hr); sensorError(hr); return; } @@ -157,9 +163,11 @@ void WinRtAmbientLightSensor::start() if (d->token.value) return; - ComPtr callback = + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + ComPtr callback = Callback(d, &WinRtAmbientLightSensorPrivate::readingChanged); - HRESULT hr = d->sensor->add_ReadingChanged(callback.Get(), &d->token); + return d->sensor->add_ReadingChanged(callback.Get(), &d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to attach to reading changed event." << qt_error_string(hr); @@ -188,14 +196,16 @@ void WinRtAmbientLightSensor::stop() if (!d->token.value) return; - HRESULT hr = d->sensor->remove_ReadingChanged(d->token); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + return d->sensor->remove_ReadingChanged(d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to detach from reading changed event." << qt_error_string(hr); sensorError(hr); return; } - d->sensor->put_ReportInterval(0); + hr = d->sensor->put_ReportInterval(0); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to reset report interval." << qt_error_string(hr); diff --git a/src/plugins/sensors/winrt/winrtcompass.cpp b/src/plugins/sensors/winrt/winrtcompass.cpp index 9c57db9..22f4ac5 100644 --- a/src/plugins/sensors/winrt/winrtcompass.cpp +++ b/src/plugins/sensors/winrt/winrtcompass.cpp @@ -38,9 +38,9 @@ #include "winrtcommon.h" #include +#include -QT_USE_NAMESPACE - +#include #include #include using namespace Microsoft::WRL; @@ -133,20 +133,24 @@ WinRtCompass::WinRtCompass(QSensor *sensor) : QSensorBackend(sensor), d_ptr(new WinRtCompassPrivate(this)) { Q_D(WinRtCompass); - HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Compass); - ComPtr factory; - HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to initialize light sensor factory." - << qt_error_string(hr); - sensorError(hr); - return; - } + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Compass); + ComPtr factory; + HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to initialize light sensor factory." + << qt_error_string(hr); + return hr; + } - hr = factory->GetDefault(&d->sensor); + hr = factory->GetDefault(&d->sensor); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to get default compass." + << qt_error_string(hr); + } + return hr; + }); if (FAILED(hr) || !d->sensor) { - qCWarning(lcWinRtSensors) << "Unable to get default compass." - << qt_error_string(hr); sensorError(hr); return; } @@ -177,9 +181,11 @@ void WinRtCompass::start() if (d->token.value) return; - ComPtr callback = + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + ComPtr callback = Callback(d, &WinRtCompassPrivate::readingChanged); - HRESULT hr = d->sensor->add_ReadingChanged(callback.Get(), &d->token); + return d->sensor->add_ReadingChanged(callback.Get(), &d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to attach to reading changed event." << qt_error_string(hr); @@ -207,15 +213,16 @@ void WinRtCompass::stop() return; if (!d->token.value) return; - - HRESULT hr = d->sensor->remove_ReadingChanged(d->token); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + return d->sensor->remove_ReadingChanged(d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to detach from reading changed event." << qt_error_string(hr); sensorError(hr); return; } - d->sensor->put_ReportInterval(0); + hr = d->sensor->put_ReportInterval(0); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to reset report interval." << qt_error_string(hr); diff --git a/src/plugins/sensors/winrt/winrtgyroscope.cpp b/src/plugins/sensors/winrt/winrtgyroscope.cpp index e7910ab..70d7980 100644 --- a/src/plugins/sensors/winrt/winrtgyroscope.cpp +++ b/src/plugins/sensors/winrt/winrtgyroscope.cpp @@ -38,7 +38,9 @@ #include "winrtcommon.h" #include +#include +#include #include #include using namespace Microsoft::WRL; @@ -111,20 +113,24 @@ WinRtGyroscope::WinRtGyroscope(QSensor *sensor) : QSensorBackend(sensor), d_ptr(new WinRtGyroscopePrivate(this)) { Q_D(WinRtGyroscope); - HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Gyrometer); - ComPtr factory; - HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to initialize gyroscope sensor factory." - << qt_error_string(hr); - sensorError(hr); - return; - } + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Gyrometer); + ComPtr factory; + HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to initialize gyroscope sensor factory." + << qt_error_string(hr); + return hr; + } - hr = factory->GetDefault(&d->sensor); + hr = factory->GetDefault(&d->sensor); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to get default gyroscope sensor." + << qt_error_string(hr); + } + return hr; + }); if (FAILED(hr) || !d->sensor) { - qCWarning(lcWinRtSensors) << "Unable to get default gyroscope sensor." - << qt_error_string(hr); sensorError(hr); return; } @@ -155,9 +161,11 @@ void WinRtGyroscope::start() if (d->token.value) return; - ComPtr callback = + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + ComPtr callback = Callback(d, &WinRtGyroscopePrivate::readingChanged); - HRESULT hr = d->sensor->add_ReadingChanged(callback.Get(), &d->token); + return d->sensor->add_ReadingChanged(callback.Get(), &d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to attach to reading changed event." << qt_error_string(hr); @@ -186,14 +194,16 @@ void WinRtGyroscope::stop() if (!d->token.value) return; - HRESULT hr = d->sensor->remove_ReadingChanged(d->token); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + return d->sensor->remove_ReadingChanged(d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to detach from reading changed event." << qt_error_string(hr); sensorError(hr); return; } - d->sensor->put_ReportInterval(0); + hr = d->sensor->put_ReportInterval(0); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to reset report interval." << qt_error_string(hr); diff --git a/src/plugins/sensors/winrt/winrtorientationsensor.cpp b/src/plugins/sensors/winrt/winrtorientationsensor.cpp index a40dbb9..c679d92 100644 --- a/src/plugins/sensors/winrt/winrtorientationsensor.cpp +++ b/src/plugins/sensors/winrt/winrtorientationsensor.cpp @@ -38,9 +38,9 @@ #include "winrtcommon.h" #include +#include -QT_USE_NAMESPACE - +#include #include #include using namespace Microsoft::WRL; @@ -119,20 +119,24 @@ WinRtOrientationSensor::WinRtOrientationSensor(QSensor *sensor) : QSensorBackend(sensor), d_ptr(new WinRtOrientationSensorPrivate(this)) { Q_D(WinRtOrientationSensor); - HStringReference classId(RuntimeClass_Windows_Devices_Sensors_SimpleOrientationSensor); - ComPtr factory; - HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to initialize orientation sensor factory." - << qt_error_string(hr); - sensorError(hr); - return; - } + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + HStringReference classId(RuntimeClass_Windows_Devices_Sensors_SimpleOrientationSensor); + ComPtr factory; + HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to initialize orientation sensor factory." + << qt_error_string(hr); + return hr; + } - hr = factory->GetDefault(&d->sensor); + hr = factory->GetDefault(&d->sensor); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to get default orientation sensor." + << qt_error_string(hr); + } + return hr; + }); if (FAILED(hr) || !d->sensor) { - qCWarning(lcWinRtSensors) << "Unable to get default orientation sensor." - << qt_error_string(hr); sensorError(hr); return; } @@ -152,9 +156,11 @@ void WinRtOrientationSensor::start() if (d->token.value) return; - ComPtr callback = + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + ComPtr callback = Callback(d, &WinRtOrientationSensorPrivate::readingChanged); - HRESULT hr = d->sensor->add_OrientationChanged(callback.Get(), &d->token); + return d->sensor->add_OrientationChanged(callback.Get(), &d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to attach to reading changed event." << qt_error_string(hr); @@ -171,7 +177,9 @@ void WinRtOrientationSensor::stop() if (!d->token.value) return; - HRESULT hr = d->sensor->remove_OrientationChanged(d->token); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + return d->sensor->remove_OrientationChanged(d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to detach from reading changed event." << qt_error_string(hr); diff --git a/src/plugins/sensors/winrt/winrtrotationsensor.cpp b/src/plugins/sensors/winrt/winrtrotationsensor.cpp index 93c19b0..570ef0b 100644 --- a/src/plugins/sensors/winrt/winrtrotationsensor.cpp +++ b/src/plugins/sensors/winrt/winrtrotationsensor.cpp @@ -38,7 +38,9 @@ #include "winrtcommon.h" #include +#include +#include #include #include using namespace Microsoft::WRL; @@ -109,20 +111,24 @@ WinRtRotationSensor::WinRtRotationSensor(QSensor *sensor) : QSensorBackend(sensor), d_ptr(new WinRtRotationSensorPrivate(this)) { Q_D(WinRtRotationSensor); - HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Inclinometer); - ComPtr factory; - HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to initialize rotation sensor factory." - << qt_error_string(hr); - sensorError(hr); - return; - } + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + HStringReference classId(RuntimeClass_Windows_Devices_Sensors_Inclinometer); + ComPtr factory; + HRESULT hr = RoGetActivationFactory(classId.Get(), IID_PPV_ARGS(&factory)); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to initialize rotation sensor factory." + << qt_error_string(hr); + return hr; + } - hr = factory->GetDefault(&d->sensor); + hr = factory->GetDefault(&d->sensor); + if (FAILED(hr)) { + qCWarning(lcWinRtSensors) << "Unable to get default rotation sensor." + << qt_error_string(hr); + } + return hr; + }); if (FAILED(hr) || !d->sensor) { - qCWarning(lcWinRtSensors) << "Unable to get default rotation sensor." - << qt_error_string(hr); sensorError(hr); return; } @@ -153,9 +159,11 @@ void WinRtRotationSensor::start() if (d->token.value) return; - ComPtr callback = + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + ComPtr callback = Callback(d, &WinRtRotationSensorPrivate::readingChanged); - HRESULT hr = d->sensor->add_ReadingChanged(callback.Get(), &d->token); + return d->sensor->add_ReadingChanged(callback.Get(), &d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to attach to reading changed event." << qt_error_string(hr); @@ -184,14 +192,16 @@ void WinRtRotationSensor::stop() if (!d->token.value) return; - HRESULT hr = d->sensor->remove_ReadingChanged(d->token); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d]() { + return d->sensor->remove_ReadingChanged(d->token); + }); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to detach from reading changed event." << qt_error_string(hr); sensorError(hr); return; } - d->sensor->put_ReportInterval(0); + hr = d->sensor->put_ReportInterval(0); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Unable to reset report interval." << qt_error_string(hr); -- cgit v1.2.1 From c398c3a93edfdb3e4f9aa4fda7eb1c981333dd03 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 3 Dec 2015 12:30:06 +0100 Subject: Make GenericTiltSensor::calibrate known to QMetaObject When using qml calibrating the tilt sensor does not work on WinRT and Windows Phone without this change. QmlTiltsensor::calibrate calls QTiltSensor::calibrate which calls QMetaObject::invokeMethod with "calibrate" on its backend. That causes the message "No such method QSensorBackend::calibrate()" without this change. Thus the meta system has to be made aware of that function. Change-Id: I539c0fb44e20fffb78bf515ba3767dafa3ce4ed6 Reviewed-by: Alex Blasche Reviewed-by: Maurice Kalinowski --- src/plugins/sensors/generic/generictiltsensor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/sensors/generic/generictiltsensor.h b/src/plugins/sensors/generic/generictiltsensor.h index a5a8f42..0f99f55 100644 --- a/src/plugins/sensors/generic/generictiltsensor.h +++ b/src/plugins/sensors/generic/generictiltsensor.h @@ -42,6 +42,7 @@ QT_BEGIN_NAMESPACE class GenericTiltSensor : public QSensorBackend, public QAccelerometerFilter { + Q_OBJECT public: static char const * const id; @@ -51,7 +52,7 @@ public: void start() Q_DECL_OVERRIDE; void stop() Q_DECL_OVERRIDE; - void calibrate(); + Q_INVOKABLE void calibrate(); bool filter(QAccelerometerReading *reading) Q_DECL_OVERRIDE; -- cgit v1.2.1 From b8bb154a30d9f35cc19d9056599750267d2f2a80 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Thu, 17 Dec 2015 14:22:53 +0100 Subject: Doc: Remove an obsolete external link. Change-Id: I88eba8f9d5ad0633bf58692245c80cc767d2ab67 Task-number: QTBUG-50013 Reviewed-by: Alex Blasche --- src/sensors/qcompass.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sensors/qcompass.cpp b/src/sensors/qcompass.cpp index e42014f..d4ad19f 100644 --- a/src/sensors/qcompass.cpp +++ b/src/sensors/qcompass.cpp @@ -61,7 +61,6 @@ IMPLEMENT_READING(QCompassReading) The calibration status of the device is measured as a number from 0 to 1. A value of 1 is the highest level that the device can support and 0 is the worst. - \sa {http://wiki.forum.nokia.com/index.php/CS001671_-_Calibrating_the_magnetometer_sensor}{CS001671 - Calibrating the magnetometer sensor} */ /*! -- cgit v1.2.1 From 3b334c8e10628a362f54651884a6552966e74a02 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 23 Dec 2015 10:33:43 +0100 Subject: Fix inconsistent use of 'override'. Change-Id: If952d7f9a0888a16c87bc75a96105c5eabc24377 Reviewed-by: Lorn Potter --- src/imports/sensors/qmlrotationsensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/sensors/qmlrotationsensor.h b/src/imports/sensors/qmlrotationsensor.h index c46c72a..be74569 100644 --- a/src/imports/sensors/qmlrotationsensor.h +++ b/src/imports/sensors/qmlrotationsensor.h @@ -55,7 +55,7 @@ Q_SIGNALS: private: QSensor *sensor() const Q_DECL_OVERRIDE; - void _update(); + void _update() Q_DECL_OVERRIDE; QRotationSensor *m_sensor; QmlSensorReading *createReading() const Q_DECL_OVERRIDE; }; -- cgit v1.2.1 From e9e4d351df2167a2326608c170131222bef7fff7 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 4 Jan 2016 08:52:32 +0100 Subject: Android: Document that Compass works on Android Task-number: QTBUG-50165 Change-Id: I1fedc47b19832c8c8400ca28314e2a374d5714de Reviewed-by: Lorn Potter --- src/sensors/doc/src/compatmap.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sensors/doc/src/compatmap.qdoc b/src/sensors/doc/src/compatmap.qdoc index c976014..8362703 100644 --- a/src/sensors/doc/src/compatmap.qdoc +++ b/src/sensors/doc/src/compatmap.qdoc @@ -103,7 +103,7 @@ Compass - + -- cgit v1.2.1 From ad52d307cbff44b77bf7d4fa923377b72bb04374 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 2 Feb 2016 09:12:01 +0100 Subject: Update qml types for QtSensors 5.6.0 release Change-Id: I9606b50810c63e49f6821e5188df54417601d11a Reviewed-by: Oliver Wolff --- src/imports/sensors/plugins.qmltypes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/sensors/plugins.qmltypes b/src/imports/sensors/plugins.qmltypes index 746230b..2c72e1f 100644 --- a/src/imports/sensors/plugins.qmltypes +++ b/src/imports/sensors/plugins.qmltypes @@ -7,7 +7,7 @@ import QtQuick.tooling 1.2 // 'qmlplugindump -nonrelocatable QtSensors 5.6' Module { - dependencies: [] + dependencies: ["QtQuick 2.0"] Component { name: "QmlAccelerometer" prototype: "QmlSensor" -- cgit v1.2.1 From fbaca62cd0a7309f04bf82101c8e20dbbf423192 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 8 Feb 2016 14:56:24 +0100 Subject: Bump version Change-Id: I3cdf3ef0e748de5900ffe36ad88d74683362cabe --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 66a0241..b642527 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.6.0 +MODULE_VERSION = 5.6.1 -- cgit v1.2.1 From 7197e7f4b385315cb241043495cbfad58deb911a Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 15 Feb 2016 12:31:02 +0100 Subject: Add change log for Qt Sensors 5.6.0 release. Change-Id: Iafe6f3c2209156b5719352c0172749014a6d2b91 Reviewed-by: Lorn Potter --- dist/changes-5.6.0 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dist/changes-5.6.0 diff --git a/dist/changes-5.6.0 b/dist/changes-5.6.0 new file mode 100644 index 0000000..6c2403e --- /dev/null +++ b/dist/changes-5.6.0 @@ -0,0 +1,27 @@ +Qt 5.6 introduces many new features and improvements as well as bugfixes +over the 5.5.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.6 series is binary compatible with the 5.5.x series. +Applications compiled for 5.5 will continue to run with 5.6. + +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. + +**************************************************************************** +* Library * +**************************************************************************** + +QtSensors +--------- + + - Fixed minor documentation issues. + - Improved various examples + - [QTBUG-49741] Fixed hanging WinRT sensor plugin. -- cgit v1.2.1 From d16eefbeac6b34939d247ae6056fc4fbbea774c5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Feb 2016 16:37:39 +0100 Subject: consistently put {qt,qml}_{module,plugin} at the end of project files this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Ia3c3f69505650fd35982fc76e385e744b877e4df Reviewed-by: Joerg Bornemann --- src/plugins/sensorgestures/qtsensors/qtsensors.pro | 9 ++++----- src/plugins/sensorgestures/shake/shake.pro | 9 ++++----- src/plugins/sensors/android/src/src.pro | 9 +++++---- src/plugins/sensors/dummy/dummy.pro | 8 ++++---- src/plugins/sensors/generic/generic.pro | 8 ++++---- src/plugins/sensors/ios/ios.pro | 8 ++++---- src/plugins/sensors/linux/linux.pro | 8 ++++---- src/plugins/sensors/sensorfw/sensorfw.pro | 8 ++++---- src/plugins/sensors/simulator/simulator.pro | 8 ++++---- src/plugins/sensors/winrt/winrt.pro | 8 ++++---- src/sensors/sensors.pro | 10 +++++----- tests/auto/qsensorgestures/plugins/test1/test1.pro | 10 +++++----- 12 files changed, 51 insertions(+), 52 deletions(-) diff --git a/src/plugins/sensorgestures/qtsensors/qtsensors.pro b/src/plugins/sensorgestures/qtsensors/qtsensors.pro index 3f8df03..44f18ff 100644 --- a/src/plugins/sensorgestures/qtsensors/qtsensors.pro +++ b/src/plugins/sensorgestures/qtsensors/qtsensors.pro @@ -1,11 +1,6 @@ TARGET = qtsensorgestures_plugin QT = core sensors -PLUGIN_TYPE = sensorgestures -PLUGIN_CLASS_NAME = QtSensorGesturePlugin -PLUGIN_EXTENDS = - -load(qt_plugin) - # Input HEADERS += qtsensorgestureplugin.h \ qcoversensorgesturerecognizer.h \ @@ -36,3 +31,7 @@ SOURCES += qtsensorgestureplugin.cpp \ OTHER_FILES += \ plugin.json +PLUGIN_TYPE = sensorgestures +PLUGIN_CLASS_NAME = QtSensorGesturePlugin +PLUGIN_EXTENDS = - +load(qt_plugin) diff --git a/src/plugins/sensorgestures/shake/shake.pro b/src/plugins/sensorgestures/shake/shake.pro index d7d8f92..efa2a0c 100644 --- a/src/plugins/sensorgestures/shake/shake.pro +++ b/src/plugins/sensorgestures/shake/shake.pro @@ -1,11 +1,6 @@ TARGET = qtsensorgestures_shakeplugin QT = core sensors -PLUGIN_TYPE = sensorgestures -PLUGIN_CLASS_NAME = QShakeSensorGesturePlugin -PLUGIN_EXTENDS = - -load(qt_plugin) - # Input HEADERS += qshakesensorgestureplugin.h \ qshakerecognizer.h @@ -15,3 +10,7 @@ SOURCES += qshakesensorgestureplugin.cpp \ OTHER_FILES += \ plugin.json +PLUGIN_TYPE = sensorgestures +PLUGIN_CLASS_NAME = QShakeSensorGesturePlugin +PLUGIN_EXTENDS = - +load(qt_plugin) diff --git a/src/plugins/sensors/android/src/src.pro b/src/plugins/sensors/android/src/src.pro index 23a6bea..8366944 100644 --- a/src/plugins/sensors/android/src/src.pro +++ b/src/plugins/sensors/android/src/src.pro @@ -1,9 +1,6 @@ TARGET = qtsensors_android -QT = sensors core -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = QCounterGesturePlugin -load(qt_plugin) +QT = sensors core # STATICPLUGIN needed because there's a Q_IMPORT_PLUGIN in main.cpp # Yes, the plugin imports itself statically @@ -36,3 +33,7 @@ SOURCES = \ androidlight.cpp OTHER_FILES = plugin.json + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = QCounterGesturePlugin +load(qt_plugin) diff --git a/src/plugins/sensors/dummy/dummy.pro b/src/plugins/sensors/dummy/dummy.pro index 93f54dc..b4ef2fd 100644 --- a/src/plugins/sensors/dummy/dummy.pro +++ b/src/plugins/sensors/dummy/dummy.pro @@ -1,10 +1,6 @@ TARGET = qtsensors_dummy QT = sensors core -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = dummySensorPlugin -load(qt_plugin) - HEADERS += dummycommon.h\ dummyaccelerometer.h\ dummylightsensor.h @@ -17,3 +13,7 @@ SOURCES += dummycommon.cpp\ OTHER_FILES = plugin.json unix:!mac:!qnx:!android:LIBS+=-lrt + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = dummySensorPlugin +load(qt_plugin) diff --git a/src/plugins/sensors/generic/generic.pro b/src/plugins/sensors/generic/generic.pro index cdb9300..cf87ccf 100644 --- a/src/plugins/sensors/generic/generic.pro +++ b/src/plugins/sensors/generic/generic.pro @@ -1,10 +1,6 @@ TARGET = qtsensors_generic QT = core sensors -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = genericSensorPlugin -load(qt_plugin) - HEADERS += generictiltsensor.h SOURCES += main.cpp\ @@ -27,3 +23,7 @@ DEFINES += QTSENSORS_GENERICORIENTATIONSENSOR QTSENSORS_GENERICALSSENSOR } OTHER_FILES = plugin.json + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = genericSensorPlugin +load(qt_plugin) diff --git a/src/plugins/sensors/ios/ios.pro b/src/plugins/sensors/ios/ios.pro index 4197b14..17ff009 100644 --- a/src/plugins/sensors/ios/ios.pro +++ b/src/plugins/sensors/ios/ios.pro @@ -1,10 +1,6 @@ TARGET = qtsensors_ios QT = core sensors -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = IOSSensorPlugin -load(qt_plugin) - OTHER_FILES = plugin.json HEADERS += iosaccelerometer.h \ @@ -23,3 +19,7 @@ OBJECTIVE_SOURCES += main.mm \ iosproximitysensor.mm LIBS += -framework UIKit -framework CoreMotion -framework CoreLocation + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = IOSSensorPlugin +load(qt_plugin) diff --git a/src/plugins/sensors/linux/linux.pro b/src/plugins/sensors/linux/linux.pro index 636bd1b..33706e7 100644 --- a/src/plugins/sensors/linux/linux.pro +++ b/src/plugins/sensors/linux/linux.pro @@ -1,13 +1,13 @@ TARGET = qtsensors_linuxsys QT = core sensors -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = LinuxSensorPlugin -load(qt_plugin) - OTHER_FILES = plugin.json !android:LIBS += -lrt HEADERS += linuxsysaccelerometer.h SOURCES += linuxsysaccelerometer.cpp \ main.cpp + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = LinuxSensorPlugin +load(qt_plugin) diff --git a/src/plugins/sensors/sensorfw/sensorfw.pro b/src/plugins/sensors/sensorfw/sensorfw.pro index 6c1408b..b30b362 100644 --- a/src/plugins/sensors/sensorfw/sensorfw.pro +++ b/src/plugins/sensors/sensorfw/sensorfw.pro @@ -1,10 +1,6 @@ TARGET = qtsensors_sensorfw QT = core sensors network dbus -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = sensorfwSensorPlugin -load(qt_plugin) - include(sensorfw.pri) @@ -16,3 +12,7 @@ CONFIGFILES.path = /etc/xdg/QtProject/ INSTALLS += CONFIGFILES OTHER_FILES = plugin.json + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = sensorfwSensorPlugin +load(qt_plugin) diff --git a/src/plugins/sensors/simulator/simulator.pro b/src/plugins/sensors/simulator/simulator.pro index b110137..ac8ea50 100644 --- a/src/plugins/sensors/simulator/simulator.pro +++ b/src/plugins/sensors/simulator/simulator.pro @@ -1,9 +1,5 @@ TARGET = qtsensors_simulator -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = SimulatorSensorPlugin -load(qt_plugin) - QT=core gui network sensors simulator HEADERS += \ @@ -30,3 +26,7 @@ SOURCES += \ main.cpp OTHER_FILES = plugin.json + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = SimulatorSensorPlugin +load(qt_plugin) diff --git a/src/plugins/sensors/winrt/winrt.pro b/src/plugins/sensors/winrt/winrt.pro index 67ae530..21996fd 100644 --- a/src/plugins/sensors/winrt/winrt.pro +++ b/src/plugins/sensors/winrt/winrt.pro @@ -1,10 +1,6 @@ TARGET = qtsensors_winrt QT = sensors core core_private -PLUGIN_TYPE = sensors -PLUGIN_CLASS_NAME = WinRtSensorPlugin -load(qt_plugin) - HEADERS += \ winrtaccelerometer.h \ winrtambientlightsensor.h \ @@ -25,3 +21,7 @@ SOURCES += \ winrtgyroscope.cpp OTHER_FILES = plugin.json + +PLUGIN_TYPE = sensors +PLUGIN_CLASS_NAME = WinRtSensorPlugin +load(qt_plugin) diff --git a/src/sensors/sensors.pro b/src/sensors/sensors.pro index a7f60e1..3e8754d 100644 --- a/src/sensors/sensors.pro +++ b/src/sensors/sensors.pro @@ -18,11 +18,6 @@ ANDROID_JAR_DEPENDENCIES = \ jar/QtSensors.jar:org.qtproject.qt5.android.sensors.QtSensors ANDROID_LIB_DEPENDENCIES = \ plugins/sensors/libqtsensors_android.so -MODULE_PLUGIN_TYPES = \ - sensors \ - sensorgestures - -load(qt_module) PUBLIC_HEADERS += \ qsensorbackend.h\ @@ -87,3 +82,8 @@ for(s,SENSORS) { } HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS $$GESTURE_HEADERS + +MODULE_PLUGIN_TYPES = \ + sensors \ + sensorgestures +load(qt_module) diff --git a/tests/auto/qsensorgestures/plugins/test1/test1.pro b/tests/auto/qsensorgestures/plugins/test1/test1.pro index f35af0d..5f89068 100644 --- a/tests/auto/qsensorgestures/plugins/test1/test1.pro +++ b/tests/auto/qsensorgestures/plugins/test1/test1.pro @@ -2,11 +2,6 @@ TARGET = qtsensorgestures_testplugin1 QT += sensors sensorgestures -PLUGIN_TYPE = sensorgestures -PLUGIN_CLASS_NAME = QTestSensorGestureDupPlugin -PLUGIN_EXTENDS = - -load(qt_plugin) - # Input HEADERS += qtestsensorgestureplugindup_p.h \ qtestrecognizerdup.h \ @@ -16,3 +11,8 @@ SOURCES += qtestsensorgestureplugindup.cpp \ qtest2recognizerduo.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +PLUGIN_TYPE = sensorgestures +PLUGIN_CLASS_NAME = QTestSensorGestureDupPlugin +PLUGIN_EXTENDS = - +load(qt_plugin) -- cgit v1.2.1 From 6c60edf84ddfd3cb23549730ccc70dfb7e1ee444 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Feb 2016 16:37:52 +0100 Subject: don't over-expose private dependencies Change-Id: I6045425fb467002db288854f9d0a8f8ea683876f Reviewed-by: Joerg Bornemann --- src/sensors/sensors.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sensors/sensors.pro b/src/sensors/sensors.pro index 3e8754d..9eeceb8 100644 --- a/src/sensors/sensors.pro +++ b/src/sensors/sensors.pro @@ -7,7 +7,7 @@ CONFIG(debug,debug|release):DEFINES += ENABLE_RUNTIME_SENSORLOG qtHaveModule(simulator) { DEFINES += SIMULATOR_BUILD - QT += simulator + QT_FOR_PRIVATE += simulator } QMAKE_DOCS = $$PWD/doc/qtsensors.qdocconf -- cgit v1.2.1 From c9ac2a3cc920e1d2976ee25f8930dae1229cf116 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 29 Feb 2016 13:40:48 +0100 Subject: Purge sRGB chunks from PNGs in examples. Subjects each *.png file that matched grep -law "sRGB" to: pngcrush -ow -brute -rem allb -reduce Change-Id: I4e15dcbf74334985f4a3e366443b2be7016e76a3 Reviewed-by: Lorn Potter --- examples/sensors/grue/grue.png | Bin 11207 -> 9319 bytes .../components/images/button_background_pressed.png | Bin 334 -> 228 bytes examples/sensors/maze/content/00.png | Bin 186 -> 70 bytes examples/sensors/maze/content/01.png | Bin 708 -> 540 bytes examples/sensors/maze/content/cheese.png | Bin 317 -> 156 bytes examples/sensors/maze/content/start.png | Bin 677 -> 505 bytes .../components/images/button_background_pressed.png | Bin 334 -> 228 bytes 7 files changed, 0 insertions(+), 0 deletions(-) diff --git a/examples/sensors/grue/grue.png b/examples/sensors/grue/grue.png index f0b070b..2727d39 100644 Binary files a/examples/sensors/grue/grue.png and b/examples/sensors/grue/grue.png differ diff --git a/examples/sensors/maze/components/images/button_background_pressed.png b/examples/sensors/maze/components/images/button_background_pressed.png index 149529e..e0ba0e7 100644 Binary files a/examples/sensors/maze/components/images/button_background_pressed.png and b/examples/sensors/maze/components/images/button_background_pressed.png differ diff --git a/examples/sensors/maze/content/00.png b/examples/sensors/maze/content/00.png index ab29a62..2522be5 100644 Binary files a/examples/sensors/maze/content/00.png and b/examples/sensors/maze/content/00.png differ diff --git a/examples/sensors/maze/content/01.png b/examples/sensors/maze/content/01.png index 0e70d1b..6146b20 100644 Binary files a/examples/sensors/maze/content/01.png and b/examples/sensors/maze/content/01.png differ diff --git a/examples/sensors/maze/content/cheese.png b/examples/sensors/maze/content/cheese.png index ecef450..c737b9d 100644 Binary files a/examples/sensors/maze/content/cheese.png and b/examples/sensors/maze/content/cheese.png differ diff --git a/examples/sensors/maze/content/start.png b/examples/sensors/maze/content/start.png index 698c0b1..581b8c9 100644 Binary files a/examples/sensors/maze/content/start.png and b/examples/sensors/maze/content/start.png differ diff --git a/examples/sensors/qmlqtsensors/components/images/button_background_pressed.png b/examples/sensors/qmlqtsensors/components/images/button_background_pressed.png index 149529e..e0ba0e7 100644 Binary files a/examples/sensors/qmlqtsensors/components/images/button_background_pressed.png and b/examples/sensors/qmlqtsensors/components/images/button_background_pressed.png differ -- cgit v1.2.1 From d43d5f5e33397fc42a5da7a8f034c7892c1226ab Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 29 Feb 2016 13:40:48 +0100 Subject: Purge sRGB chunks from PNGs in documentation. Subjects each *.png file that matched grep -law "sRGB" to: pngcrush -ow -brute -rem allb -reduce -force Change-Id: Ie54ce7153b23632cf2673f6f82ae8b3e4dec6e67 Reviewed-by: Lorn Potter --- .../sensors/accelbubble/doc/images/accelbubble.png | Bin 5181 -> 5025 bytes .../grue/doc/images/qtsensors-examples-grue.png | Bin 12278 -> 7511 bytes .../doc/images/qtsensors-examples-explorer.png | Bin 39873 -> 39820 bytes src/sensors/doc/images/cubehouse.png | Bin 39408 -> 39346 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/examples/sensors/accelbubble/doc/images/accelbubble.png b/examples/sensors/accelbubble/doc/images/accelbubble.png index 84e876d..ad4cfc0 100644 Binary files a/examples/sensors/accelbubble/doc/images/accelbubble.png and b/examples/sensors/accelbubble/doc/images/accelbubble.png differ diff --git a/examples/sensors/grue/doc/images/qtsensors-examples-grue.png b/examples/sensors/grue/doc/images/qtsensors-examples-grue.png index 81b3725..f434827 100644 Binary files a/examples/sensors/grue/doc/images/qtsensors-examples-grue.png and b/examples/sensors/grue/doc/images/qtsensors-examples-grue.png differ diff --git a/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png b/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png index 0976b9f..888fc3c 100644 Binary files a/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png and b/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png differ diff --git a/src/sensors/doc/images/cubehouse.png b/src/sensors/doc/images/cubehouse.png index e3ff7fa..dac833e 100644 Binary files a/src/sensors/doc/images/cubehouse.png and b/src/sensors/doc/images/cubehouse.png differ -- cgit v1.2.1 From c93d02d5fa181d133b043f56b3a67a19ee9a9122 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 1 Mar 2016 11:06:23 +0100 Subject: Update supported sensors table for iOS Change-Id: I3885849352a59a23989605f0e62a594bd4c61db1 Reviewed-by: Alex Blasche --- src/sensors/doc/src/compatmap.qdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sensors/doc/src/compatmap.qdoc b/src/sensors/doc/src/compatmap.qdoc index 8362703..4de1b7e 100644 --- a/src/sensors/doc/src/compatmap.qdoc +++ b/src/sensors/doc/src/compatmap.qdoc @@ -85,7 +85,7 @@ Ambient Light Sensor - + @@ -175,7 +175,7 @@ Orientation Sensor - + @@ -205,7 +205,7 @@ Rotation Sensor - + @@ -225,7 +225,7 @@ Tilt Sensor - + -- cgit v1.2.1 From ce413b6500b7f4d605cf1c71ce7f2d3dd5d5cc84 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 2 Mar 2016 17:01:26 +0100 Subject: Cleanup dead links in QCompassReading Task-number: QTBUG-50165 Change-Id: I7a5e195ad5ea4d390609303e9ae7c047ecbf2399 Reviewed-by: Lorn Potter Reviewed-by: Venugopal Shivashankar --- src/sensors/qcompass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sensors/qcompass.cpp b/src/sensors/qcompass.cpp index d4ad19f..46075a7 100644 --- a/src/sensors/qcompass.cpp +++ b/src/sensors/qcompass.cpp @@ -50,7 +50,7 @@ IMPLEMENT_READING(QCompassReading) \section2 QCompassReading Units The compass returns the azimuth of the device as degrees from magnetic north in a clockwise direction based on the top of the device, - as defined by QPlatformScreen::nativeOrientation. + as defined by QScreen::nativeOrientation. There is also a value to indicate the calibration status of the device. If the device is not calibrated the azimuth may not be accurate. @@ -92,7 +92,7 @@ void QCompassReading::setAzimuth(qreal azimuth) \brief the calibration level of the reading. Measured as a value from 0 to 1 with higher values being better. - \sa {QCompassReading Units}, {http://wiki.forum.nokia.com/index.php/CS001671_-_Calibrating_the_magnetometer_sensor}{CS001671 - Calibrating the magnetometer sensor} + \sa {QCompassReading Units} */ qreal QCompassReading::calibrationLevel() const -- cgit v1.2.1 From da9112e6385eac93bfb467d169e1d001d83e1ce9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Mar 2016 10:20:37 +0100 Subject: Make public headers compile with -Wzero-as-null-pointer-constant ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Task-number: QTBUG-45291 Change-Id: Iaa6ea07220566adc323010c52233416e6ae2b726 Reviewed-by: Lorn Potter --- src/sensors/gestures/qsensorgesture.h | 2 +- src/sensors/gestures/qsensorgesturemanager.h | 2 +- src/sensors/gestures/qsensorgesturerecognizer.h | 2 +- src/sensors/qaccelerometer.h | 2 +- src/sensors/qaltimeter.h | 2 +- src/sensors/qambientlightsensor.h | 2 +- src/sensors/qambienttemperaturesensor.h | 2 +- src/sensors/qcompass.h | 2 +- src/sensors/qdistancesensor.h | 2 +- src/sensors/qgyroscope.h | 2 +- src/sensors/qholstersensor.h | 2 +- src/sensors/qirproximitysensor.h | 2 +- src/sensors/qlightsensor.h | 2 +- src/sensors/qmagnetometer.h | 2 +- src/sensors/qorientationsensor.h | 2 +- src/sensors/qpressuresensor.h | 2 +- src/sensors/qproximitysensor.h | 2 +- src/sensors/qrotationsensor.h | 2 +- src/sensors/qsensor.h | 8 ++++---- src/sensors/qsensorbackend.h | 2 +- src/sensors/qtapsensor.h | 2 +- src/sensors/qtiltsensor.h | 2 +- 22 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/sensors/gestures/qsensorgesture.h b/src/sensors/gestures/qsensorgesture.h index 46d7e77..dda7d25 100644 --- a/src/sensors/gestures/qsensorgesture.h +++ b/src/sensors/gestures/qsensorgesture.h @@ -52,7 +52,7 @@ class Q_SENSORS_EXPORT QSensorGesture : public QObject { //Do not use Q_OBJECT here public: - QSensorGesture(const QStringList &ids, QObject *parent = 0); + QSensorGesture(const QStringList &ids, QObject *parent = Q_NULLPTR); ~QSensorGesture(); bool isActive(); diff --git a/src/sensors/gestures/qsensorgesturemanager.h b/src/sensors/gestures/qsensorgesturemanager.h index cda4e18..ee7e77a 100644 --- a/src/sensors/gestures/qsensorgesturemanager.h +++ b/src/sensors/gestures/qsensorgesturemanager.h @@ -49,7 +49,7 @@ class Q_SENSORS_EXPORT QSensorGestureManager : public QObject Q_DECLARE_PRIVATE(QSensorGestureManager) public: - explicit QSensorGestureManager(QObject *parent = 0); + explicit QSensorGestureManager(QObject *parent = Q_NULLPTR); ~QSensorGestureManager(); diff --git a/src/sensors/gestures/qsensorgesturerecognizer.h b/src/sensors/gestures/qsensorgesturerecognizer.h index de6ad02..675ff61 100644 --- a/src/sensors/gestures/qsensorgesturerecognizer.h +++ b/src/sensors/gestures/qsensorgesturerecognizer.h @@ -47,7 +47,7 @@ class Q_SENSORS_EXPORT QSensorGestureRecognizer : public QObject { Q_OBJECT public: - QSensorGestureRecognizer(QObject *parent = 0); + QSensorGestureRecognizer(QObject *parent = Q_NULLPTR); virtual ~QSensorGestureRecognizer(); virtual QString id() const = 0; diff --git a/src/sensors/qaccelerometer.h b/src/sensors/qaccelerometer.h index 9f8cd8c..2db65c9 100644 --- a/src/sensors/qaccelerometer.h +++ b/src/sensors/qaccelerometer.h @@ -75,7 +75,7 @@ class Q_SENSORS_EXPORT QAccelerometer : public QSensor Q_PROPERTY(AccelerationMode accelerationMode READ accelerationMode WRITE setAccelerationMode NOTIFY accelerationModeChanged) public: - explicit QAccelerometer(QObject *parent = 0); + explicit QAccelerometer(QObject *parent = Q_NULLPTR); virtual ~QAccelerometer(); // Keep this enum in sync with QmlAccelerometer::AccelerationMode diff --git a/src/sensors/qaltimeter.h b/src/sensors/qaltimeter.h index 46be769..85b353e 100644 --- a/src/sensors/qaltimeter.h +++ b/src/sensors/qaltimeter.h @@ -61,7 +61,7 @@ class Q_SENSORS_EXPORT QAltimeter : public QSensor { Q_OBJECT public: - explicit QAltimeter(QObject *parent = 0); + explicit QAltimeter(QObject *parent = Q_NULLPTR); ~QAltimeter(); QAltimeterReading *reading() const; static char const * const type; diff --git a/src/sensors/qambientlightsensor.h b/src/sensors/qambientlightsensor.h index 37f3723..53182f9 100644 --- a/src/sensors/qambientlightsensor.h +++ b/src/sensors/qambientlightsensor.h @@ -72,7 +72,7 @@ class Q_SENSORS_EXPORT QAmbientLightSensor : public QSensor { Q_OBJECT public: - explicit QAmbientLightSensor(QObject *parent = 0); + explicit QAmbientLightSensor(QObject *parent = Q_NULLPTR); virtual ~QAmbientLightSensor(); QAmbientLightReading *reading() const; static char const * const type; diff --git a/src/sensors/qambienttemperaturesensor.h b/src/sensors/qambienttemperaturesensor.h index 5dabac5..93f3efd 100644 --- a/src/sensors/qambienttemperaturesensor.h +++ b/src/sensors/qambienttemperaturesensor.h @@ -61,7 +61,7 @@ class Q_SENSORS_EXPORT QAmbientTemperatureSensor : public QSensor { Q_OBJECT public: - explicit QAmbientTemperatureSensor(QObject *parent = 0); + explicit QAmbientTemperatureSensor(QObject *parent = Q_NULLPTR); ~QAmbientTemperatureSensor(); QAmbientTemperatureReading *reading() const; static char const * const type; diff --git a/src/sensors/qcompass.h b/src/sensors/qcompass.h index acb7653..1069b6c 100644 --- a/src/sensors/qcompass.h +++ b/src/sensors/qcompass.h @@ -66,7 +66,7 @@ class Q_SENSORS_EXPORT QCompass : public QSensor { Q_OBJECT public: - explicit QCompass(QObject *parent = 0); + explicit QCompass(QObject *parent = Q_NULLPTR); virtual ~QCompass(); QCompassReading *reading() const; static char const * const type; diff --git a/src/sensors/qdistancesensor.h b/src/sensors/qdistancesensor.h index bcc1e73..e181923 100644 --- a/src/sensors/qdistancesensor.h +++ b/src/sensors/qdistancesensor.h @@ -62,7 +62,7 @@ class Q_SENSORS_EXPORT QDistanceSensor : public QSensor { Q_OBJECT public: - explicit QDistanceSensor(QObject *parent = 0); + explicit QDistanceSensor(QObject *parent = Q_NULLPTR); ~QDistanceSensor(); QDistanceReading *reading() const; static char const * const type; diff --git a/src/sensors/qgyroscope.h b/src/sensors/qgyroscope.h index 59ea405..202503d 100644 --- a/src/sensors/qgyroscope.h +++ b/src/sensors/qgyroscope.h @@ -70,7 +70,7 @@ class Q_SENSORS_EXPORT QGyroscope : public QSensor { Q_OBJECT public: - explicit QGyroscope(QObject *parent = 0); + explicit QGyroscope(QObject *parent = Q_NULLPTR); virtual ~QGyroscope(); QGyroscopeReading *reading() const; static char const * const type; diff --git a/src/sensors/qholstersensor.h b/src/sensors/qholstersensor.h index b201a61..6f9d1d8 100644 --- a/src/sensors/qholstersensor.h +++ b/src/sensors/qholstersensor.h @@ -61,7 +61,7 @@ class Q_SENSORS_EXPORT QHolsterSensor : public QSensor { Q_OBJECT public: - explicit QHolsterSensor(QObject *parent = 0); + explicit QHolsterSensor(QObject *parent = Q_NULLPTR); ~QHolsterSensor(); QHolsterReading *reading() const; static char const * const type; diff --git a/src/sensors/qirproximitysensor.h b/src/sensors/qirproximitysensor.h index 32f0c88..f81f116 100644 --- a/src/sensors/qirproximitysensor.h +++ b/src/sensors/qirproximitysensor.h @@ -62,7 +62,7 @@ class Q_SENSORS_EXPORT QIRProximitySensor : public QSensor { Q_OBJECT public: - explicit QIRProximitySensor(QObject *parent = 0); + explicit QIRProximitySensor(QObject *parent = Q_NULLPTR); virtual ~QIRProximitySensor(); QIRProximityReading *reading() const; static char const * const type; diff --git a/src/sensors/qlightsensor.h b/src/sensors/qlightsensor.h index fdebeb1..b56b284 100644 --- a/src/sensors/qlightsensor.h +++ b/src/sensors/qlightsensor.h @@ -65,7 +65,7 @@ class Q_SENSORS_EXPORT QLightSensor : public QSensor Q_OBJECT Q_PROPERTY(qreal fieldOfView READ fieldOfView NOTIFY fieldOfViewChanged) public: - explicit QLightSensor(QObject *parent = 0); + explicit QLightSensor(QObject *parent = Q_NULLPTR); virtual ~QLightSensor(); QLightReading *reading() const; static char const * const type; diff --git a/src/sensors/qmagnetometer.h b/src/sensors/qmagnetometer.h index 8a0c6d2..8020c02 100644 --- a/src/sensors/qmagnetometer.h +++ b/src/sensors/qmagnetometer.h @@ -77,7 +77,7 @@ class Q_SENSORS_EXPORT QMagnetometer : public QSensor Q_OBJECT Q_PROPERTY(bool returnGeoValues READ returnGeoValues WRITE setReturnGeoValues NOTIFY returnGeoValuesChanged) public: - explicit QMagnetometer(QObject *parent = 0); + explicit QMagnetometer(QObject *parent = Q_NULLPTR); virtual ~QMagnetometer(); QMagnetometerReading *reading() const; static char const * const type; diff --git a/src/sensors/qorientationsensor.h b/src/sensors/qorientationsensor.h index c92f64f..badb67e 100644 --- a/src/sensors/qorientationsensor.h +++ b/src/sensors/qorientationsensor.h @@ -73,7 +73,7 @@ class Q_SENSORS_EXPORT QOrientationSensor : public QSensor { Q_OBJECT public: - explicit QOrientationSensor(QObject *parent = 0); + explicit QOrientationSensor(QObject *parent = Q_NULLPTR); virtual ~QOrientationSensor(); QOrientationReading *reading() const; static char const * const type; diff --git a/src/sensors/qpressuresensor.h b/src/sensors/qpressuresensor.h index a9bfaaa..1a907c0 100644 --- a/src/sensors/qpressuresensor.h +++ b/src/sensors/qpressuresensor.h @@ -65,7 +65,7 @@ class Q_SENSORS_EXPORT QPressureSensor : public QSensor { Q_OBJECT public: - explicit QPressureSensor(QObject *parent = 0); + explicit QPressureSensor(QObject *parent = Q_NULLPTR); ~QPressureSensor(); QPressureReading *reading() const; static char const * const type; diff --git a/src/sensors/qproximitysensor.h b/src/sensors/qproximitysensor.h index d44a050..a55c3d7 100644 --- a/src/sensors/qproximitysensor.h +++ b/src/sensors/qproximitysensor.h @@ -62,7 +62,7 @@ class Q_SENSORS_EXPORT QProximitySensor : public QSensor { Q_OBJECT public: - explicit QProximitySensor(QObject *parent = 0); + explicit QProximitySensor(QObject *parent = Q_NULLPTR); virtual ~QProximitySensor(); QProximityReading *reading() const; static char const * const type; diff --git a/src/sensors/qrotationsensor.h b/src/sensors/qrotationsensor.h index 3b21493..1da85ed 100644 --- a/src/sensors/qrotationsensor.h +++ b/src/sensors/qrotationsensor.h @@ -70,7 +70,7 @@ class Q_SENSORS_EXPORT QRotationSensor : public QSensor Q_OBJECT Q_PROPERTY(bool hasZ READ hasZ NOTIFY hasZChanged) public: - explicit QRotationSensor(QObject *parent = 0); + explicit QRotationSensor(QObject *parent = Q_NULLPTR); virtual ~QRotationSensor(); QRotationReading *reading() const; static char const * const type; diff --git a/src/sensors/qsensor.h b/src/sensors/qsensor.h index a5f78f9..cb86e53 100644 --- a/src/sensors/qsensor.h +++ b/src/sensors/qsensor.h @@ -110,7 +110,7 @@ public: UserOrientation }; - explicit QSensor(const QByteArray &type, QObject *parent = 0); + explicit QSensor(const QByteArray &type, QObject *parent = Q_NULLPTR); virtual ~QSensor(); QByteArray identifier() const; @@ -201,7 +201,7 @@ Q_SIGNALS: void bufferSizeChanged(int bufferSize); protected: - explicit QSensor(const QByteArray &type, QSensorPrivate &dd, QObject* parent = 0); + explicit QSensor(const QByteArray &type, QSensorPrivate &dd, QObject* parent = Q_NULLPTR); QSensorBackend *backend() const; private: @@ -255,7 +255,7 @@ private: #define DECLARE_READING_D(classname, pclassname)\ public:\ - classname(QObject *parent = 0);\ + classname(QObject *parent = Q_NULLPTR);\ virtual ~classname();\ void copyValuesFrom(QSensorReading *other);\ private:\ @@ -266,7 +266,7 @@ private: #define IMPLEMENT_READING_D(classname, pclassname)\ classname::classname(QObject *parent)\ - : QSensorReading(parent, 0)\ + : QSensorReading(parent, Q_NULLPTR)\ , d(new pclassname)\ {}\ classname::~classname() {}\ diff --git a/src/sensors/qsensorbackend.h b/src/sensors/qsensorbackend.h index 460d318..753cab9 100644 --- a/src/sensors/qsensorbackend.h +++ b/src/sensors/qsensorbackend.h @@ -45,7 +45,7 @@ class Q_SENSORS_EXPORT QSensorBackend : public QObject { Q_OBJECT public: - explicit QSensorBackend(QSensor *sensor, QObject *parent = 0); + explicit QSensorBackend(QSensor *sensor, QObject *parent = Q_NULLPTR); virtual ~QSensorBackend(); virtual void start() = 0; diff --git a/src/sensors/qtapsensor.h b/src/sensors/qtapsensor.h index ada6a65..0d6b70e 100644 --- a/src/sensors/qtapsensor.h +++ b/src/sensors/qtapsensor.h @@ -87,7 +87,7 @@ class Q_SENSORS_EXPORT QTapSensor : public QSensor Q_PROPERTY(bool returnDoubleTapEvents READ returnDoubleTapEvents WRITE setReturnDoubleTapEvents NOTIFY returnDoubleTapEventsChanged) public: - explicit QTapSensor(QObject *parent = 0); + explicit QTapSensor(QObject *parent = Q_NULLPTR); virtual ~QTapSensor(); QTapReading *reading() const; static char const * const type; diff --git a/src/sensors/qtiltsensor.h b/src/sensors/qtiltsensor.h index 6aac321..cbc1ba3 100644 --- a/src/sensors/qtiltsensor.h +++ b/src/sensors/qtiltsensor.h @@ -68,7 +68,7 @@ class Q_SENSORS_EXPORT QTiltSensor : public QSensor { Q_OBJECT public: - explicit QTiltSensor(QObject *parent = 0); + explicit QTiltSensor(QObject *parent = Q_NULLPTR); ~QTiltSensor(); QTiltReading *reading() const; static char const * const type; -- cgit v1.2.1 From 1e42bf9e28ee0578277047735a5be24fc68abb2c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Mar 2016 10:21:59 +0100 Subject: Make more ctors explicit Added explicit where it was missing. This is not a source- incompatible change, because code that breaks by this is a bug. Let's not have this sitting around in an LTS. Change-Id: Iadcd2f1c751bb5a9cef96b2732bb3a7a8e34c6f8 Reviewed-by: Lorn Potter --- src/sensors/gestures/qsensorgesture.h | 2 +- src/sensors/gestures/qsensorgesturerecognizer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sensors/gestures/qsensorgesture.h b/src/sensors/gestures/qsensorgesture.h index dda7d25..af3fbba 100644 --- a/src/sensors/gestures/qsensorgesture.h +++ b/src/sensors/gestures/qsensorgesture.h @@ -52,7 +52,7 @@ class Q_SENSORS_EXPORT QSensorGesture : public QObject { //Do not use Q_OBJECT here public: - QSensorGesture(const QStringList &ids, QObject *parent = Q_NULLPTR); + explicit QSensorGesture(const QStringList &ids, QObject *parent = Q_NULLPTR); ~QSensorGesture(); bool isActive(); diff --git a/src/sensors/gestures/qsensorgesturerecognizer.h b/src/sensors/gestures/qsensorgesturerecognizer.h index 675ff61..c8e406a 100644 --- a/src/sensors/gestures/qsensorgesturerecognizer.h +++ b/src/sensors/gestures/qsensorgesturerecognizer.h @@ -47,7 +47,7 @@ class Q_SENSORS_EXPORT QSensorGestureRecognizer : public QObject { Q_OBJECT public: - QSensorGestureRecognizer(QObject *parent = Q_NULLPTR); + explicit QSensorGestureRecognizer(QObject *parent = Q_NULLPTR); virtual ~QSensorGestureRecognizer(); virtual QString id() const = 0; -- cgit v1.2.1