-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMyScene.h
35 lines (34 loc) · 873 Bytes
/
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
#pragma once
#include <qgraphicsscene.h>
#include<QGraphicsSceneEvent>
#include<QPixmap>
#include<QPaintEvent>
#include<QPainter>
#include<QGraphicsItemGroup>
#include<ROI.h>
#include<qDebug>
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;
};