-
Notifications
You must be signed in to change notification settings - Fork 2
/
widget.h
141 lines (95 loc) · 2.62 KB
/
widget.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#ifndef WIDGET_H
#define WIDGET_H
//#include "QGraphicsPartitionItem.h"
#include "GraphicsView.h"
#include <QPainter>
#include <QWidget>
#include <QColorDialog>
#include <QFontDialog>
#include <QGraphicsPixmapItem>
namespace Ui {
class Widget;
}
//For test
class CurrentFrame
{
public:
CurrentFrame()
{
width=640;
height=480;
mImage = new QPixmap(640,480);
QPainter painter;
painter.begin(mImage);
QPen pen;
pen.setWidth(1);
pen.setColor(QColor(255,0,0));
QBrush brush;
brush.setColor(QColor(128,128,128));
painter.setPen(pen);
painter.setBrush(brush);
painter.fillRect(QRect(0,0,640,480),QBrush(QColor(255,255,255)));
// painter.drawRect(QRect(0,0,639,479));
//painter.fillRect(QRect(100,100,50,50),QBrush(QColor(255,0,0)));
painter.end();
mImage->save("bg.bmp");
}
~CurrentFrame()
{
delete mImage;
}
int width;
int height;
QPixmap* mImage;
};
class Widget : public QWidget
{
Q_OBJECT
public:
explicit Widget(QWidget *parent = 0);
~Widget();
protected:
void flipImage();
private slots:
void on_Marker_clicked();
void on_SelectItem_clicked();
void on_DrawLine_clicked();
void on_Pencil_clicked();
void on_Text_clicked();
void on_Image_clicked();
void on_Curve_clicked();
void on_DrawRect_clicked();
void on_Ellipse_clicked();
void on_Time_clicked();
void on_Distance_clicked();
void on_InnerDegree_clicked();
void on_OutterDegree_clicked();
void on_CloneRect_clicked();
//void on_Horizontal_clicked();
//void on_Vertical_clicked();
void on_MakerPen_clicked();
void on_Color_clicked();
void on_font_clicked();
void on_opacity_valueChanged(int value);
void on_lineStyle_currentIndexChanged(const QString &arg1);
void on_LineWidth_currentIndexChanged(int index);
void on_brushColor_clicked();
void on_delete_2_clicked();
void on_copy_clicked();
void on_setOrder_clicked();
void on_SetAsScale_clicked();
void on_paste_clicked();
void on_save_clicked();
void on_load_clicked();
void on_cut_clicked();
void on_Zoom_clicked();
void on_Move_clicked();
void on_HFlip_stateChanged(int arg1);
void on_VFlip_stateChanged(int arg1);
private:
Ui::Widget *ui;
CurrentFrame cf;
QGraphicsPixmapItem * curFrame;
QGraphicsScene* myscene;
};
#endif // WIDGET_H