From f6c090502058c63f7a51b7ba97672022657119d8 Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Sun, 11 Jun 2023 00:17:54 +0100 Subject: StepsDataLoader: add a property that updates today's live step count this also changes the behaviour of getTodayTotal() --- qmlplugin/stepsDataLoader.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qmlplugin/stepsDataLoader.h') 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 #include +#include + 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 getDataForDate(QDate date); Q_INVOKABLE QList getTodayData(); Q_INVOKABLE void triggerDaemonRecording(); + +signals: + void todayTotalChanged(); private: QDBusInterface *m_iface; + QStepCounterSensor *m_stepcounterSensor; }; #endif // STEPSDATALOADER_H -- cgit v1.2.3-54-g00ecf