-
Notifications
You must be signed in to change notification settings - Fork 4
/
model.h
50 lines (35 loc) · 1.06 KB
/
model.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 MODEL_H
#define MODEL_H
#include "square.h"
#include <QGraphicsItem>
#include <QtWidgets>
#include <QList>
#include "shape.h"
#include "arrow.h"
class model : public QGraphicsScene
{
public:
model();
QList<QGraphicsItem *> listActiveItems;
enum DesiredAction {Action_CreateShape, Action_CreateLineStart, Action_CreateLineEnd, Action_MoveObject, Action_Drag, Action_Delete};
void create(QListWidgetItem *item);
void label();
void createRect(QColor color, qreal x, qreal y);
void updateScene();
void theSaveList();
void openNewApplication();
void setAction(DesiredAction action);
void setColor(int c);
void setDispText(QString text);
void createOpenShape(qreal x, qreal y, QString shapeName);
void createOpenShape(qreal x, qreal y, QString shapeName, QString text);
public Q_SLOTS:
void shapeSelection();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
private:
DesiredAction currentAction;
Shape *lineBeginItem;
Shape *lineEndItem;
};
#endif // MODEL_H