diff options
author | Shashwat <shaavan.github@gmail.com> | 2022-01-12 19:06:28 +0530 |
---|---|---|
committer | Shashwat <shaavan.github@gmail.com> | 2022-01-18 20:03:50 +0530 |
commit | f7a19ef774ef92ce348215593e3590a750c345e1 (patch) | |
tree | b76de9e250f8c2225c1c8b34cae53ad97d9f4a91 /src/qt/trafficgraphwidget.h | |
parent | 16781e1bc9f8ffc721ebea73434e0066957bc959 (diff) | |
download | bitcoin-f7a19ef774ef92ce348215593e3590a750c345e1.tar.xz |
qt,refactor: Use std::chrono in TrafficGraphWidget class
Diffstat (limited to 'src/qt/trafficgraphwidget.h')
-rw-r--r-- | src/qt/trafficgraphwidget.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qt/trafficgraphwidget.h b/src/qt/trafficgraphwidget.h index 2d8c825815..a40b734540 100644 --- a/src/qt/trafficgraphwidget.h +++ b/src/qt/trafficgraphwidget.h @@ -8,6 +8,8 @@ #include <QWidget> #include <QQueue> +#include <chrono> + class ClientModel; QT_BEGIN_NAMESPACE @@ -22,14 +24,14 @@ class TrafficGraphWidget : public QWidget public: explicit TrafficGraphWidget(QWidget *parent = nullptr); void setClientModel(ClientModel *model); - int getGraphRangeMins() const; + std::chrono::minutes getGraphRange() const; protected: void paintEvent(QPaintEvent *) override; public Q_SLOTS: void updateRates(); - void setGraphRangeMins(int mins); + void setGraphRange(std::chrono::minutes new_range); void clear(); private: @@ -37,7 +39,7 @@ private: QTimer *timer; float fMax; - int nMins; + std::chrono::minutes m_range{0}; QQueue<float> vSamplesIn; QQueue<float> vSamplesOut; quint64 nLastBytesIn; |