diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2021-01-04 15:47:33 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-10 15:16:52 -0800 |
commit | eb2b0f0a3eb9cf84970c9a21dda9553112b99b17 (patch) | |
tree | bf25194d1cdc96975f2279e566474e09bf6299ac /mobile-widgets/statsmanager.h | |
parent | d77f25432850ea2e2ea9e7fb84c49d52c3a308eb (diff) | |
download | subsurface-eb2b0f0a3eb9cf84970c9a21dda9553112b99b17.tar.gz |
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 <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/statsmanager.h')
-rw-r--r-- | mobile-widgets/statsmanager.h | 25 |
1 files changed, 24 insertions, 1 deletions
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 <QStringList> + 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 |