Changeset View
Changeset View
Standalone View
Standalone View
src/qt/trafficgraphwidget.cpp
Show All 16 Lines | |||||
#define XMARGIN 10 | #define XMARGIN 10 | ||||
#define YMARGIN 10 | #define YMARGIN 10 | ||||
TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) | TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) | ||||
: QWidget(parent), timer(0), fMax(0.0f), nMins(0), vSamplesIn(), | : QWidget(parent), timer(0), fMax(0.0f), nMins(0), vSamplesIn(), | ||||
vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(0) { | vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(0) { | ||||
timer = new QTimer(this); | timer = new QTimer(this); | ||||
connect(timer, SIGNAL(timeout()), SLOT(updateRates())); | connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates); | ||||
} | } | ||||
void TrafficGraphWidget::setClientModel(ClientModel *model) { | void TrafficGraphWidget::setClientModel(ClientModel *model) { | ||||
clientModel = model; | clientModel = model; | ||||
if (model) { | if (model) { | ||||
nLastBytesIn = model->node().getTotalBytesRecv(); | nLastBytesIn = model->node().getTotalBytesRecv(); | ||||
nLastBytesOut = model->node().getTotalBytesSent(); | nLastBytesOut = model->node().getTotalBytesSent(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |