Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
trafficgraphwidget.cpp
Go to the documentation of this file.
50 void TrafficGraphWidget::paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser)
84 painter.fillRect(drawRect.adjusted(1, 1, -1, -1), GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BACKGROUND_WIDGET));
125 const TrafficGraphData::SampleQueue& queue = trafficGraphData.getCurrentRangeQueueWithAverageBandwidth();
148 QRect textRect = painter.boundingRect(QRect(XMARGIN, YMARGIN + h - (h * val / fMax) - yMarginText, 0, 0), Qt::AlignLeft, QString("%1 %2").arg(val).arg(units));
154 QRect textRect2 = painter.boundingRect(QRect(XMARGIN, YMARGIN + h - (h * val2 / fMax) - yMarginText, 0, 0), Qt::AlignLeft, QString("%1 %2").arg(val2).arg(units));
184 QRect rectOuter = QRect(drawRect.width() - nWidthStats - nMarginStats, nMarginStats, nWidthStats, nHeightStats);
210 painter.fillRect(rectContent, GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BACKGROUND_NETSTATS));
216 painter.drawText(rectInBytes, Qt::AlignRight, GUIUtil::formatBytes(trafficGraphData.getLastBytesIn()));
218 painter.drawText(rectOutBytes, Qt::AlignRight, GUIUtil::formatBytes(trafficGraphData.getLastBytesOut()));
231 bool updated = trafficGraphData.update(clientModel->getTotalBytesRecv(),clientModel->getTotalBytesSent());
235 for (const TrafficSample& sample : trafficGraphData.getCurrentRangeQueueWithAverageBandwidth()) {
255 trafficGraphData.setLastBytes(clientModel->getTotalBytesRecv(), clientModel->getTotalBytesSent());
QFont getFont(FontFamily family, QFont::Weight qWeight, bool fItalic, int nPointSize)
Get a properly weighted QFont object with the selected font.
Definition: guiutil.cpp:1666
void setLastBytes(quint64 nLastBytesIn, quint64 nLastBytesOut)
Definition: trafficgraphdata.cpp:53
QColor getThemedQColor(ThemedColor color)
Helper to get colors for various themes which can't be applied via css for some reason.
Definition: guiutil.cpp:204
static const int SMALLEST_SAMPLE_PERIOD
Definition: trafficgraphdata.h:50
void paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser)
Definition: trafficgraphwidget.cpp:50
TrafficGraphData trafficGraphData
Definition: trafficgraphwidget.h:47
void setGraphRangeMins(int value)
Definition: trafficgraphwidget.cpp:244
static const int DESIRED_DATA_SAMPLES
Definition: trafficgraphdata.h:49
int getGraphRangeMins() const
Definition: trafficgraphwidget.cpp:44
Definition: trafficgraphdata.h:31
boost::function< float(const TrafficSample &)> SampleChooser
Definition: trafficgraphwidget.h:40
Definition: trafficgraphdata.h:7
bool update(const TrafficSample &trafficSample)
Definition: trafficgraphdata.cpp:68
void switchRange(GraphRange newRange)
Definition: trafficgraphdata.cpp:128
SampleQueue getCurrentRangeQueueWithAverageBandwidth()
Definition: trafficgraphdata.cpp:252
void setClientModel(ClientModel *model)
Definition: trafficgraphwidget.cpp:36
TrafficGraphWidget(QWidget *parent=0)
Definition: trafficgraphwidget.cpp:22