forked from challinan/pmd-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
widget.h
50 lines (37 loc) · 1.1 KB
/
widget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QMouseEvent>
#include "data.h"
#include "helper.h"
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent,QWidget *mainWindow);
void initialized(TGraphType gType, float graphScale);
TGraphType getGraphType() { return m_helper.getGraphType(); }
float getGraphWaveSize() { return m_helper.getGraphXScale(); }
void clearWidget();
bool clearGraph(QPainter *painterWidget);
void setScrollingMode(bool bValue);
void updateOffScreen(QRect dirtyRect);
public slots:
void animate(signed short int graphData);
signals:
void mouseClickEvent(Widget *);
protected:
void paintEvent(QPaintEvent *event);
void mouseReleaseEvent ( QMouseEvent * e );
void mousePressEvent ( QMouseEvent * e );
private:
Helper m_helper;
bool m_scrollEnable;
bool m_firstEntry;
// member variable - flag of click beginning
bool m_mouseClick;
bool m_clearWidget;
QImage *m_image;
QPainter *m_imagePainter;
};
#endif // WIDGET_H