lbrycrd/src/qt/trafficgraphwidget.h
Wladimir J. van der Laan d29ec6c230 qt: define QT_NO_KEYWORDS
QT_NO_KEYWORDS prevents Qt from defining the `foreach`, `signals`,
`slots` and `emit` macros.

Avoid overlap between Qt macros and boost - for example #undef hackiness
in #6421.
2015-07-15 07:30:23 +02:00

48 lines
1 KiB
C++

// Copyright (c) 2011-2013 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_TRAFFICGRAPHWIDGET_H
#define BITCOIN_QT_TRAFFICGRAPHWIDGET_H
#include <QWidget>
#include <QQueue>
class ClientModel;
QT_BEGIN_NAMESPACE
class QPaintEvent;
class QTimer;
QT_END_NAMESPACE
class TrafficGraphWidget : public QWidget
{
Q_OBJECT
public:
explicit TrafficGraphWidget(QWidget *parent = 0);
void setClientModel(ClientModel *model);
int getGraphRangeMins() const;
protected:
void paintEvent(QPaintEvent *);
public Q_SLOTS:
void updateRates();
void setGraphRangeMins(int mins);
void clear();
private:
void paintPath(QPainterPath &path, QQueue<float> &samples);
QTimer *timer;
float fMax;
int nMins;
QQueue<float> vSamplesIn;
QQueue<float> vSamplesOut;
quint64 nLastBytesIn;
quint64 nLastBytesOut;
ClientModel *clientModel;
};
#endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H