Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
trafficgraphwidget.h
Go to the documentation of this file.
1// Copyright (c) 2011-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_QT_TRAFFICGRAPHWIDGET_H
6#define BITCOIN_QT_TRAFFICGRAPHWIDGET_H
7
8#include <QWidget>
9#include <QQueue>
10
11#include <chrono>
12
13class ClientModel;
14
16class QPaintEvent;
17class QTimer;
19
20class TrafficGraphWidget : public QWidget
21{
23
24public:
25 explicit TrafficGraphWidget(QWidget *parent = nullptr);
26 void setClientModel(ClientModel *model);
27
28protected:
29 void paintEvent(QPaintEvent *) override;
30
31public Q_SLOTS:
32 void updateRates();
33 void setGraphRange(std::chrono::minutes new_range);
34 void clear();
35
36private:
38
39 QTimer* timer{nullptr};
40 float fMax{0.0f};
41 std::chrono::minutes m_range{0};
47};
48
49#endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H
Model for Bitcoin network client.
Definition clientmodel.h:57
std::chrono::minutes m_range
void paintEvent(QPaintEvent *) override
ClientModel * clientModel
void setClientModel(ClientModel *model)
QQueue< float > vSamplesOut
void paintPath(QPainterPath &path, QQueue< float > &samples)
void setGraphRange(std::chrono::minutes new_range)
QQueue< float > vSamplesIn
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:82