summaryrefslogtreecommitdiffstats
path: root/interactioncanvas.h
blob: af5d9b668f5ea7f77cb6e927537db24dd54a7391 (plain)
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
#ifndef INTERACTIONCANVAS_H
#define INTERACTIONCANVAS_H

#include <QLabel>
#include <QDebug>
#include <QMouseEvent>
#include <QList>
#include <QPoint>
#include <QPainter>

#include "line.h"

class InteractionCanvas : public QLabel
{
public:
    InteractionCanvas();
    ~InteractionCanvas();

    // QWidget interface
protected:
    void mouseMoveEvent(QMouseEvent *mouseEvent);
    void mousePressEvent(QMouseEvent *mouseEvent);
    void mouseReleaseEvent(QMouseEvent *mouseEvent);
    void keyPressEvent(QKeyEvent *keyEvent);
    void keyReleaseEvent(QKeyEvent *keyEvent);

private:
    QList<Line> m_Lines;
    Line *m_Line;
    QPoint m_MousePressPoint;
    QPoint m_MouseReleasePoint;
    QPoint m_LastMousePosition;

    QPainter *normalPainter;
    QPainter *tempPainter;

    // QWidget interface
protected:
    void paintEvent(QPaintEvent *paintEvent);
};

#endif // INTERACTIONCANVAS_H