diff options
author | Maurice Kalinowski <maurice.kalinowski@digia.com> | 2014-08-08 10:30:16 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@digia.com> | 2014-08-08 13:34:18 +0200 |
commit | b11494a1e51aba86ce945911ffbdc693a7eabff6 (patch) | |
tree | a3f71d0fa00c4e40aa0a1aec72fdaf063746e840 /src/plugins/sensors/winrt/winrtcompass.cpp | |
parent | 4383fa5df7a220670e0ae6567e56b8a5809d0704 (diff) |
Set dataRates for sensors
Some sensors need to set a dataRate in which they are providing values.
Values are in Hz, hence the conversion and defaults to 1Hz like on other
backends as well.
Task-number: QTBUG-40664
Change-Id: I980155f9b4b2772e8420df4b51e8ebb5cdea6037
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Diffstat (limited to 'src/plugins/sensors/winrt/winrtcompass.cpp')
-rw-r--r-- | src/plugins/sensors/winrt/winrtcompass.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/sensors/winrt/winrtcompass.cpp b/src/plugins/sensors/winrt/winrtcompass.cpp index c2b72405..9a3a150c 100644 --- a/src/plugins/sensors/winrt/winrtcompass.cpp +++ b/src/plugins/sensors/winrt/winrtcompass.cpp @@ -164,6 +164,9 @@ WinRtCompass::WinRtCompass(QSensor *sensor) return; } + addDataRate(1, 1000 / d->minimumReportInterval); // dataRate in Hz + sensor->setDataRate(1); + setReading<QCompassReading>(&d->reading); } |