2021-01-07 14:12:25 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef STATSMANAGER_H
|
|
|
|
#define STATSMANAGER_H
|
|
|
|
|
|
|
|
#include "stats/statsview.h"
|
|
|
|
#include "stats/statsstate.h"
|
|
|
|
|
2021-01-04 14:47:33 +00:00
|
|
|
#include <QStringList>
|
|
|
|
|
2021-01-07 14:12:25 +00:00
|
|
|
class StatsManager : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-01-04 14:47:33 +00:00
|
|
|
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)
|
|
|
|
|
2021-01-07 14:12:25 +00:00
|
|
|
StatsManager();
|
|
|
|
~StatsManager();
|
2021-01-04 14:47:33 +00:00
|
|
|
Q_INVOKABLE void init(StatsView *v, QObject *o);
|
2021-01-07 14:12:25 +00:00
|
|
|
Q_INVOKABLE void doit();
|
2021-01-04 14:47:33 +00:00
|
|
|
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();
|
2021-01-07 14:12:25 +00:00
|
|
|
private:
|
|
|
|
StatsView *view;
|
|
|
|
StatsState state;
|
2021-01-04 14:47:33 +00:00
|
|
|
QStringList var1List;
|
|
|
|
QStringList binner1List;
|
|
|
|
QStringList var2List;
|
|
|
|
QStringList binner2List;
|
|
|
|
StatsState::UIState uiState; // Remember UI state so that we can interpret indexes
|
|
|
|
void updateUi();
|
|
|
|
|
2021-01-07 14:12:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|