aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/statswidget.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-28 14:36:09 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-03 13:41:15 -0800
commit165dce4a0eb8c0832861ede8dfb874933667eae8 (patch)
tree0056ce59d696fac5e431213b8245098a60dc81ee /desktop-widgets/statswidget.h
parent319a7af31afe3b3b1ba03114b01e88c7067709f0 (diff)
downloadsubsurface-165dce4a0eb8c0832861ede8dfb874933667eae8.tar.gz
statistics: implement a statistics widget on desktop
Implement a widget that shows the statistics state as comboboxes and the statistics chart. Calls into the statistics code if any of the comboboxes changes. The hardest part here is the formatting of the charts list with its icons and with headings. Sadly, it is not trivial to arrange icons horizontally. Therefore we would have to fully reimplement the ComboBox view, which is probably not fun. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/statswidget.h')
-rw-r--r--desktop-widgets/statswidget.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/desktop-widgets/statswidget.h b/desktop-widgets/statswidget.h
new file mode 100644
index 000000000..40e6d106c
--- /dev/null
+++ b/desktop-widgets/statswidget.h
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef STATSWIDGET_H
+#define STATSWIDGET_H
+
+#include "stats/statsstate.h"
+#include "stats/chartlistmodel.h"
+#include "ui_statswidget.h"
+#include <vector>
+#include <memory>
+
+class QCheckBox;
+
+class StatsWidget : public QWidget {
+ Q_OBJECT
+public:
+ StatsWidget(QWidget *parent = 0);
+private
+slots:
+ void closeStats();
+ void chartTypeChanged(int);
+ void var1Changed(int);
+ void var2Changed(int);
+ void var1BinnerChanged(int);
+ void var2BinnerChanged(int);
+ void var2OperationChanged(int);
+ void featureChanged(int, bool);
+private:
+ Ui::StatsWidget ui;
+ StatsState state;
+ void updateUi();
+ std::vector<std::unique_ptr<QCheckBox>> features;
+
+ ChartListModel charts;
+ //QStringListModel charts;
+ void showEvent(QShowEvent *) override;
+};
+
+#endif // STATSWIDGET_H