From eb2b0f0a3eb9cf84970c9a21dda9553112b99b17 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 4 Jan 2021 15:47:33 +0100 Subject: mobile/statistics: add a statistics page on mobile This adds a reasonably flexibile mobile page that tries to do the right thing for both portrait and landscape mode. In order to get the most out of a mobile screen, it's implemented in a way that always gives it the full screen (it does so by emptying out the page stack and being the only page shown - brutal, but effective). This commit also contains a bunch of other random cleanups that didn't really justify being in separate commits. Parts of this was written by Berthold, hence the double SOB. Signed-off-by: Dirk Hohndel Signed-off-by: Berthold Stoeger --- mobile-widgets/statsmanager.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/statsmanager.h') diff --git a/mobile-widgets/statsmanager.h b/mobile-widgets/statsmanager.h index 3cae244c0..bfdf6724b 100644 --- a/mobile-widgets/statsmanager.h +++ b/mobile-widgets/statsmanager.h @@ -5,16 +5,39 @@ #include "stats/statsview.h" #include "stats/statsstate.h" +#include + class StatsManager : public QObject { Q_OBJECT public: + Q_PROPERTY(QStringList var1List MEMBER var1List NOTIFY var1ListChanged) + Q_PROPERTY(QStringList binner1List MEMBER binner1List NOTIFY binner1ListChanged) + Q_PROPERTY(QStringList var2List MEMBER var2List NOTIFY var2ListChanged) + Q_PROPERTY(QStringList binner2List MEMBER binner2List NOTIFY binner2ListChanged) + StatsManager(); ~StatsManager(); - Q_INVOKABLE void init(StatsView *v); + Q_INVOKABLE void init(StatsView *v, QObject *o); Q_INVOKABLE void doit(); + Q_INVOKABLE void var1Changed(int idx); + Q_INVOKABLE void var1BinnerChanged(int idx); + Q_INVOKABLE void var2Changed(int idx); + Q_INVOKABLE void var2BinnerChanged(int idx); +signals: + void var1ListChanged(); + void binner1ListChanged(); + void var2ListChanged(); + void binner2ListChanged(); private: StatsView *view; StatsState state; + QStringList var1List; + QStringList binner1List; + QStringList var2List; + QStringList binner2List; + StatsState::UIState uiState; // Remember UI state so that we can interpret indexes + void updateUi(); + }; #endif -- cgit v1.2.3-70-g09d2