-
Notifications
You must be signed in to change notification settings - Fork 6
/
commands.h
59 lines (46 loc) · 1.19 KB
/
commands.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
51
52
53
54
55
56
57
58
59
#ifndef COMMANDS_H
#define COMMANDS_H
#include <QUndoCommand>
#include "figure.h"
#include "paintscene.h"
#include <QTableWidget>
class AddCommand : public QUndoCommand
{
public:
AddCommand(PaintScene *graphicsScene,
Figure* item,QPointF LastPoint,QTableWidget* table,QUndoCommand *parent = 0);
~AddCommand();
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
Figure *myDiagramItem;
PaintScene *myGraphicsScene;
QPointF initialPosition;
QTableWidget* table;
bool WasModified;
bool IsFirstTime;
bool WillModify;
};
class DeleteCommand : public QUndoCommand
{
public:
DeleteCommand(PaintScene *graphicsScene,
Figure* item,QPointF LastPoint,QTableWidget* table,QUndoCommand *parent = 0);
~DeleteCommand();
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
Figure *myDiagramItem;
PaintScene *myGraphicsScene;
QPointF initialPosition;
QTableWidget* table;
bool WasModified;
bool IsFirstTime;
bool WillModify;
int ItemIndex;
};
class ButtonsCommand{
public:
static void clearScene(PaintScene* scene);
};
#endif // COMMANDS_H