Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

trafficgraphwidget.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 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 <qt/trafficgraphdata.h>
9 
10 #include <boost/function.hpp>
11 
12 #include <QWidget>
13 #include <QQueue>
14 
15 class ClientModel;
16 
17 QT_BEGIN_NAMESPACE
18 class QPaintEvent;
19 class QTimer;
20 QT_END_NAMESPACE
21 
22 class TrafficGraphWidget : public QWidget
23 {
24  Q_OBJECT
25 
26 public:
27  explicit TrafficGraphWidget(QWidget *parent = 0);
28  void setClientModel(ClientModel *model);
29  int getGraphRangeMins() const;
30 
31 protected:
32  void paintEvent(QPaintEvent *);
33 
34 public Q_SLOTS:
35  void updateRates();
36  void setGraphRangeMins(int value);
37  void clear();
38 
39 private:
40  typedef boost::function<float(const TrafficSample&)> SampleChooser;
41  void paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser);
42 
43  QTimer *timer;
44  float fMax;
45  int nMins;
48 };
49 
50 #endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H
ClientModel * clientModel
void paintEvent(QPaintEvent *)
QQueue< TrafficSample > SampleQueue
void paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser)
TrafficGraphData trafficGraphData
void setGraphRangeMins(int value)
Model for Dash network client.
Definition: clientmodel.h:42
boost::function< float(const TrafficSample &)> SampleChooser
void setClientModel(ClientModel *model)
TrafficGraphWidget(QWidget *parent=0)
Released under the MIT license