subsurface/desktop-widgets/statswidget.h
Berthold Stoeger 5a8d7617ce statistics: implement primitive "restrict to selection" feature
Allow the user to restrict the analyzed dives based on the
current selection. One button restricts to the current selection
and one button resets the restriction.

Thus, the user can for example select bars in the bar chart
or a range in the scatter plot and perform statistics on
these sets.

The restriction works on top of the filter.

The UI can certainly be improved, but it is a start.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-02-13 13:02:54 -08:00

42 lines
872 B
C++

// 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 StatsView;
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);
void restrict();
void unrestrict();
private:
Ui::StatsWidget ui;
StatsState state;
StatsView *view;
void updateUi();
void updateRestrictionLabel();
std::vector<std::unique_ptr<QCheckBox>> features;
ChartListModel charts;
void showEvent(QShowEvent *) override;
};
#endif // STATSWIDGET_H