Bitcoin Core
28.99.0
P2P Digital Currency
src
qt
trafficgraphwidget.h
Go to the documentation of this file.
1
// Copyright (c) 2011-2022 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
13
class
ClientModel
;
14
15
QT_BEGIN_NAMESPACE
16
class
QPaintEvent;
17
class
QTimer;
18
QT_END_NAMESPACE
19
20
class
TrafficGraphWidget
:
public
QWidget
21
{
22
Q_OBJECT
23
24
public
:
25
explicit
TrafficGraphWidget
(QWidget *parent =
nullptr
);
26
void
setClientModel
(
ClientModel
*model);
27
std::chrono::minutes
getGraphRange
()
const
;
28
29
protected
:
30
void
paintEvent
(QPaintEvent *)
override
;
31
32
public
Q_SLOTS:
33
void
updateRates
();
34
void
setGraphRange
(std::chrono::minutes new_range);
35
void
clear
();
36
37
private
:
38
void
paintPath
(QPainterPath &path, QQueue<float> &samples);
39
40
QTimer*
timer
{
nullptr
};
41
float
fMax
{0.0f};
42
std::chrono::minutes
m_range
{0};
43
QQueue<float>
vSamplesIn
;
44
QQueue<float>
vSamplesOut
;
45
quint64
nLastBytesIn
{0};
46
quint64
nLastBytesOut
{0};
47
ClientModel
*
clientModel
{
nullptr
};
48
};
49
50
#endif
// BITCOIN_QT_TRAFFICGRAPHWIDGET_H
ClientModel
Model for Bitcoin network client.
Definition:
clientmodel.h:57
TrafficGraphWidget
Definition:
trafficgraphwidget.h:21
TrafficGraphWidget::m_range
std::chrono::minutes m_range
Definition:
trafficgraphwidget.h:42
TrafficGraphWidget::fMax
float fMax
Definition:
trafficgraphwidget.h:41
TrafficGraphWidget::paintEvent
void paintEvent(QPaintEvent *) override
Definition:
trafficgraphwidget.cpp:58
TrafficGraphWidget::updateRates
void updateRates()
Definition:
trafficgraphwidget.cpp:117
TrafficGraphWidget::clientModel
ClientModel * clientModel
Definition:
trafficgraphwidget.h:47
TrafficGraphWidget::TrafficGraphWidget
TrafficGraphWidget(QWidget *parent=nullptr)
Definition:
trafficgraphwidget.cpp:22
TrafficGraphWidget::clear
void clear()
Definition:
trafficgraphwidget.cpp:158
TrafficGraphWidget::timer
QTimer * timer
Definition:
trafficgraphwidget.h:40
TrafficGraphWidget::getGraphRange
std::chrono::minutes getGraphRange() const
Definition:
trafficgraphwidget.cpp:40
TrafficGraphWidget::setClientModel
void setClientModel(ClientModel *model)
Definition:
trafficgraphwidget.cpp:31
TrafficGraphWidget::nLastBytesOut
quint64 nLastBytesOut
Definition:
trafficgraphwidget.h:46
TrafficGraphWidget::vSamplesOut
QQueue< float > vSamplesOut
Definition:
trafficgraphwidget.h:44
TrafficGraphWidget::paintPath
void paintPath(QPainterPath &path, QQueue< float > &samples)
Definition:
trafficgraphwidget.cpp:42
TrafficGraphWidget::setGraphRange
void setGraphRange(std::chrono::minutes new_range)
Definition:
trafficgraphwidget.cpp:148
TrafficGraphWidget::nLastBytesIn
quint64 nLastBytesIn
Definition:
trafficgraphwidget.h:45
TrafficGraphWidget::vSamplesIn
QQueue< float > vSamplesIn
Definition:
trafficgraphwidget.h:43
Generated on Wed Dec 18 2024 20:00:11 for Bitcoin Core by
1.9.4