diff options
Diffstat (limited to 'src/graphwidget.h')
-rw-r--r-- | src/graphwidget.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/graphwidget.h b/src/graphwidget.h new file mode 100644 index 0000000..f43e0db --- /dev/null +++ b/src/graphwidget.h @@ -0,0 +1,33 @@ +#ifndef GRAPHWIDGET_H_ +#define GRAPHWIDGET_H_ + +#include <QWidget> + +class IDataSource; + +class GraphWidget : public QWidget +{ + Q_OBJECT +public: + GraphWidget(QWidget* parent = NULL); + virtual ~GraphWidget(); + + void setDataSource(IDataSource* source); + void readNextValue(); + +protected: + virtual void resizeEvent(QResizeEvent * event); + virtual void paintEvent(QPaintEvent * event); + +private: + static const int HISTSIZE = 2000; + static const QColor LINE_COLOR, BACK_COLOR, BAR_COLOR; + IDataSource* _source; + qint64 _history[HISTSIZE]; + int _histPos; + float _vScale; + bool _doubleSpace; + QRect _updateRectSmall; +}; + +#endif /* GRAPHWIDGET_H_ */ |