PIVX Core  5.6.99
P2P Digital Currency
trafficgraphwidget.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Copyright (c) 2017-2019 The PIVX Core developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef PIVX_QT_TRAFFICGRAPHWIDGET_H
7 #define PIVX_QT_TRAFFICGRAPHWIDGET_H
8 
9 #include <QQueue>
10 #include <QWidget>
11 
12 class ClientModel;
13 
14 QT_BEGIN_NAMESPACE
15 class QPaintEvent;
16 class QTimer;
17 QT_END_NAMESPACE
18 
19 class TrafficGraphWidget : public QWidget
20 {
21  Q_OBJECT
22 
23 public:
24  explicit TrafficGraphWidget(QWidget* parent = 0);
25  void setClientModel(ClientModel* model);
26  int getGraphRangeMins() const;
27 
28 protected:
29  void paintEvent(QPaintEvent*);
30 
31 public Q_SLOTS:
32  void updateRates();
33  void setGraphRangeMins(int mins);
34  void clear();
35 
36 private:
37  void paintPath(QPainterPath& path, QQueue<float>& samples);
38 
39  QTimer* timer;
40  float fMax;
41  int nMins;
42  QQueue<float> vSamplesIn;
43  QQueue<float> vSamplesOut;
44  quint64 nLastBytesIn;
45  quint64 nLastBytesOut;
47 };
48 
49 #endif // PIVX_QT_TRAFFICGRAPHWIDGET_H
Model for PIVX network client.
Definition: clientmodel.h:50
ClientModel * clientModel
void paintEvent(QPaintEvent *)
void setClientModel(ClientModel *model)
TrafficGraphWidget(QWidget *parent=0)
void setGraphRangeMins(int mins)
QQueue< float > vSamplesOut
void paintPath(QPainterPath &path, QQueue< float > &samples)
QQueue< float > vSamplesIn