From d4f10f9fe446da2aff65088e5236d6ffcdd034b5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 24 Feb 2017 12:33:55 +0100 Subject: initial commit --- src/graphwidget.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/graphwidget.h (limited to 'src/graphwidget.h') 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 + +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_ */ -- cgit v1.2.3-55-g7522