-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyscene.h
40 lines (36 loc) · 1.01 KB
/
myscene.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
#ifndef MYSCENE_H
#define MYSCENE_H
#include<QGraphicsScene>
#include<QGraphicsSceneEvent>
#include<QPixmap>
#include<QPaintEvent>
#include<QPainter>
#include<QGraphicsItemGroup>
class MyScene :
public QGraphicsScene
{
Q_OBJECT
public:
explicit MyScene(QObject *parent= Q_NULLPTR);
~MyScene();
//ÉèÖñÊË¢
void setBrush(bool checkBoxBrush, bool checkBoxClean);
void setBrushSize(int brushSize);
void setBounding(QPointF topLeft, QPointF bottomRight);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent * event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
QRectF bounding;
QPointF previousPoint;
int brushSize = 5;
//»æͼ¿ØÖƱäÁ¿
bool checkBoxBrush = false;
bool brushMode = false;
bool cleanMode = false;
bool brushing = false;
bool cleaning = false;
bool brushBackground = false;
};
#endif // MYSCENE_H