2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-04-04 17:21:30 +00:00
|
|
|
#ifndef TAB_DIVE_STATISTICS_H
|
|
|
|
#define TAB_DIVE_STATISTICS_H
|
|
|
|
|
|
|
|
#include "TabBase.h"
|
2020-02-03 18:33:06 +00:00
|
|
|
#include "core/subsurface-qt/divelistnotifier.h"
|
2017-04-04 17:21:30 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class TabDiveStatistics;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TabDiveStatistics : public TabBase {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-04-04 18:01:47 +00:00
|
|
|
TabDiveStatistics(QWidget *parent = 0);
|
2017-04-04 17:21:30 +00:00
|
|
|
~TabDiveStatistics();
|
2018-09-29 20:13:44 +00:00
|
|
|
void updateData() override;
|
|
|
|
void clear() override;
|
2017-04-04 17:21:30 +00:00
|
|
|
|
2019-10-06 19:31:39 +00:00
|
|
|
private slots:
|
|
|
|
void divesChanged(const QVector<dive *> &dives, DiveField field);
|
2020-05-05 09:55:23 +00:00
|
|
|
void cylinderChanged(dive *d);
|
2019-10-06 19:31:39 +00:00
|
|
|
|
2017-04-04 17:21:30 +00:00
|
|
|
private:
|
|
|
|
Ui::TabDiveStatistics *ui;
|
|
|
|
};
|
|
|
|
|
2020-10-26 16:05:37 +00:00
|
|
|
// Widget describing, minimum, maximum and average value.
|
|
|
|
// Scheduled for removal in due course.
|
|
|
|
class QLabel;
|
|
|
|
class MinMaxAvgWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
QLabel *avgIco, *avgValue;
|
|
|
|
QLabel *minIco, *minValue;
|
|
|
|
QLabel *maxIco, *maxValue;
|
|
|
|
public:
|
|
|
|
MinMaxAvgWidget(QWidget *parent);
|
|
|
|
double minimum() const;
|
|
|
|
double maximum() const;
|
|
|
|
double average() const;
|
|
|
|
void setMinimum(double minimum);
|
|
|
|
void setMaximum(double maximum);
|
|
|
|
void setAverage(double average);
|
|
|
|
void setMinimum(const QString &minimum);
|
|
|
|
void setMaximum(const QString &maximum);
|
|
|
|
void setAverage(const QString &average);
|
|
|
|
void overrideMinToolTipText(const QString &newTip);
|
|
|
|
void overrideAvgToolTipText(const QString &newTip);
|
|
|
|
void overrideMaxToolTipText(const QString &newTip);
|
|
|
|
void setAvgVisibility(bool visible);
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2017-04-04 17:21:30 +00:00
|
|
|
#endif
|