mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-22 00:43:44 +08:00
6fac6698d5
* new drive stats design * match design better * clean up old-commit-hash: 28ab1bcaca06904808c61a1764285abf5231084a
26 lines
515 B
C++
26 lines
515 B
C++
#pragma once
|
|
|
|
#include <QJsonDocument>
|
|
#include <QLabel>
|
|
|
|
class DriveStats : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DriveStats(QWidget* parent = 0);
|
|
|
|
private:
|
|
void showEvent(QShowEvent *event) override;
|
|
void updateStats();
|
|
inline QString getDistanceUnit() const { return metric_ ? "KM" : "Miles"; }
|
|
|
|
bool metric_;
|
|
QJsonDocument stats_;
|
|
struct StatsLabels {
|
|
QLabel *routes, *distance, *distance_unit, *hours;
|
|
} all_, week_;
|
|
|
|
private slots:
|
|
void parseResponse(const QString &response);
|
|
};
|