-
Notifications
You must be signed in to change notification settings - Fork 1
/
centralwidget.h
executable file
·109 lines (84 loc) · 3.1 KB
/
centralwidget.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
#ifndef CENTRALWIDGET_H
#define CENTRALWIDGET_H
#include <QWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QStandardItemModel>
#include <QTableView>
#include <QGroupBox>
#include <QAction>
#include <QFrame>
#include <QPushButton>
#include <QButtonGroup>
#include <QFileInfo>
#include <QModelIndex>
#include <QMouseEvent>
#include <QPixmap>
#include <QStringList>
#include "pixitem.h"
#include "scanwidget.h"
#define MAXIMAGECOUNT 10 //define array maxnum
class CentralWidget : public QWidget
{
Q_OBJECT
public:
QTableView *imageTable;
CentralWidget(QWidget *parent = 0);
~CentralWidget();
void createView(); //create view and scene
void setupModel(); //setup model
void setupView(); //setup view
void deleteSeletedImage(); //delete the seleted image
void deleteSeletedMusic(); //delete the seleted music
void createToolGroup(); //create image process tool group box
void createBtns();
void resumeTableView();
void addimageTable(QFileInfo fileInfo); //set up image model
void addmusicTable(QFileInfo fileInfo); //set up music model
QString getImageName(); //get the image table image name
QString getMusicName(); //get the music table music name
QStringList getAllImageName(int &num); //get all the image name
//select the selected row
QModelIndex imageSelectedRow();
QModelIndex musicSelectedRow();
void imageSelectedEvent();
protected slots:
void translateLeftAction(); //actions slots
void translateRightAction();
void translateUpAction();
void translateDownAction();
void zoominAction();
void zoomoutAction();
void rotateRightAction();
void rotateLeftAction();
void shearRigthAction();
void shearLeftAction();
//void mirrorHorizontalAction();
//void mirrorVerticalAction();
private:
QStandardItemModel *imageModel; //model
QStandardItemModel *musicModel;
QTableView *musicTable;
QGraphicsView *view;
QGraphicsScene *scene; //scene
PixItem *pixItem;
ScanWidget *scanWidget;
QFrame *ctrlFrame;
QHBoxLayout *buttonLayout; //control the image button layout
//control the image buttons
QPushButton *translateLeftBtn;
QPushButton *translateRightBtn;
QPushButton *translateUpBtn;
QPushButton *translateDownBtn;
QPushButton *zoominBtn;
QPushButton *zoomoutBtn;
QPushButton *rotateRightBtn;
QPushButton *rotateLeftBtn;
QPushButton *shearRightBtn;
QPushButton *shearLeftBtn;
//QPushButton *mirrorHorizontalBtn;
//QPushButton *mirrorVerticalBtn;
};
#endif // CENTRALWIDGET_H