diff options
author | Arseniy-Movshev <dodoradio@outlook.com> | 2023-06-11 00:17:54 +0100 |
---|---|---|
committer | Arseniy-Movshev <dodoradio@outlook.com> | 2023-06-20 00:05:28 +0100 |
commit | f6c090502058c63f7a51b7ba97672022657119d8 (patch) | |
tree | 4481872fa3d05e2d767f1533a2ee1eba43cfb7ac /qmlplugin/stepsDataLoader.h | |
parent | 451388685a13669561b778e5719379db39164d47 (diff) |
StepsDataLoader: add a property that updates today's live step count
this also changes the behaviour of getTodayTotal()
Diffstat (limited to 'qmlplugin/stepsDataLoader.h')
-rw-r--r-- | qmlplugin/stepsDataLoader.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qmlplugin/stepsDataLoader.h b/qmlplugin/stepsDataLoader.h index a1bcb5d..f29dcb2 100644 --- a/qmlplugin/stepsDataLoader.h +++ b/qmlplugin/stepsDataLoader.h @@ -15,9 +15,12 @@ #include <QDBusInterface> #include <QPointF> +#include <QtSensors/QStepCounterSensor> + class StepsDataLoader : public QObject { Q_OBJECT + Q_PROPERTY(int todayTotal READ getTodayTotal() NOTIFY todayTotalChanged()) public: explicit StepsDataLoader(); @@ -26,8 +29,12 @@ public: Q_INVOKABLE QList<QPointF> getDataForDate(QDate date); Q_INVOKABLE QList<QPointF> getTodayData(); Q_INVOKABLE void triggerDaemonRecording(); + +signals: + void todayTotalChanged(); private: QDBusInterface *m_iface; + QStepCounterSensor *m_stepcounterSensor; }; #endif // STEPSDATALOADER_H |