summaryrefslogtreecommitdiffstats
path: root/src/sensorsquick
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-06-08 16:46:33 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-15 09:39:08 +0000
commit7a82ee1645ef0df9c766031edd20ea99d5ea7b6e (patch)
tree6ba9bd20bdc08a7b98a416d9b6495cbfa39516e0 /src/sensorsquick
parent3fc0d1114a17d37a84ffc620394180c19a579deb (diff)
Make sensor possible to indicate it is no longer busy
The current implementation allowed sensor backend to only indicate that it is busy, but not to tell when it was freed again. This commit allows sensor backend to indicate also that it's busy state has cleared. It is up to the sensor implementation to decide if it makes sense / is possible to do that or not. Task-number: QTBUG-92513 Task-number: QTBUG-92505 Change-Id: Ied4857850e81346031fd83aa347d9955081118e8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit f8445fdcbf75e455443304bc290c48c37961e9f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/sensorsquick')
-rw-r--r--src/sensorsquick/qmlsensor.cpp1
-rw-r--r--src/sensorsquick/qmlsensor_p.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/sensorsquick/qmlsensor.cpp b/src/sensorsquick/qmlsensor.cpp
index 7957a663..14dc21c7 100644
--- a/src/sensorsquick/qmlsensor.cpp
+++ b/src/sensorsquick/qmlsensor.cpp
@@ -447,6 +447,7 @@ void QmlSensor::componentComplete()
connect(sensor(), SIGNAL(bufferSizeChanged(int)), this, SIGNAL(bufferSizeChanged(int)));
connect(sensor(), SIGNAL(maxBufferSizeChanged(int)), this, SIGNAL(maxBufferSizeChanged(int)));
connect(sensor(), SIGNAL(efficientBufferSizeChanged(int)), this, SIGNAL(efficientBufferSizeChanged(int)));
+ connect(sensor(), &QSensor::busyChanged, this, &QmlSensor::busyChanged);
// We need to set this on the sensor object now
sensor()->setIdentifier(m_identifier.toLocal8Bit());
diff --git a/src/sensorsquick/qmlsensor_p.h b/src/sensorsquick/qmlsensor_p.h
index 55d4eb42..2b893c99 100644
--- a/src/sensorsquick/qmlsensor_p.h
+++ b/src/sensorsquick/qmlsensor_p.h
@@ -78,7 +78,7 @@ class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensor : public QObject, public QQmlParse
Q_PROPERTY(QQmlListProperty<QmlSensorRange> availableDataRates READ availableDataRates NOTIFY availableDataRatesChanged)
Q_PROPERTY(int dataRate READ dataRate WRITE setDataRate NOTIFY dataRateChanged)
Q_PROPERTY(QmlSensorReading* reading READ reading NOTIFY readingChanged)
- Q_PROPERTY(bool busy READ isBusy)
+ Q_PROPERTY(bool busy READ isBusy NOTIFY busyChanged)
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
Q_PROPERTY(QQmlListProperty<QmlSensorOutputRange> outputRanges READ outputRanges NOTIFY outputRangesChanged)
Q_PROPERTY(int outputRange READ outputRange WRITE setOutputRange NOTIFY outputRangeChanged)
@@ -173,6 +173,7 @@ Q_SIGNALS:
void descriptionChanged();
void errorChanged();
void alwaysOnChanged();
+ void busyChanged();
Q_REVISION(1) void skipDuplicatesChanged(bool skipDuplicates);
Q_REVISION(1) void axesOrientationModeChanged(AxesOrientationMode axesOrientationMode);
Q_REVISION(1) void currentOrientationChanged(int currentOrientation);