-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcd.cpp
More file actions
202 lines (171 loc) · 5.32 KB
/
cd.cpp
File metadata and controls
202 lines (171 loc) · 5.32 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#include "cd.h"
#include "ui_cd.h"
QSqlQuery query;
QSqlDatabase db;
QSqlQueryModel *model;
newdoc *usenewdoc;
archivesdoc *usearchivesdoc;
outbound *useoutbound;
inventory *useinventory;
fileexport *usefileexport;
statistical *usestatistical;
usermanagement *useusermanagement;
organizationmangement *useorganizationmangement;
extern QString LandingRole;
cd::cd(QWidget *parent) :
QDialog(parent),
ui(new Ui::cd)
{
//git
setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
setAutoFillBackground(true);//必须有这条语句
setPalette(QPalette(QColor(140,140,140)));
usenewdoc=new newdoc(this);
usearchivesdoc=new archivesdoc(this);
useoutbound=new outbound(this);
useinventory=new inventory(this);
usefileexport=new fileexport(this);
usestatistical=new statistical(this);
useusermanagement=new usermanagement(this);
useorganizationmangement=new organizationmangement(this);
usenewdoc->hide();
//usearchivesdoc->hide();
useoutbound->hide();
useinventory->hide();
usefileexport->hide();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->hide();
ui->setupUi(this);
ui->pushButton_inventory->hide();
ui->pushButton_export->hide();
ui->pushButton_OrganizationMangement->hide();
ui->pushButton_Statistical->hide();
qDebug() <<"登陆角色:"+LandingRole;
//IGNAL(sendDatanewdoc(QByteArray, int)), dialog, SLOT(sendMsg(QByteArray, int)));
connect(usenewdoc,SIGNAL(sendDatanewdoc(QByteArray, int)),useoutbound,SLOT(sendMsg(QByteArray, int)));//当点击子界面时,调用主界面的reshow()函
}
cd::~cd()
{
delete ui;
db.close();
}
void cd::resizeEvent(QResizeEvent *event){
int WM=ui->pushButton_newdoc->x()+ui->pushButton_newdoc->width();
//WM=WM+0.04*WM;
int HM=height()*0.04;
int WS=width()-(ui->pushButton_newdoc->x()+ui->pushButton_newdoc->width());
WM=WM+0.02*WS;
WS=WS*(1.0-0.04);
int HS=height()*(1.0-0.08);
usenewdoc->move(WM,HM); //移动位置
usenewdoc->setFixedSize(WS,HS); //设置窗体大小
usearchivesdoc->move(WM,HM); //移动位置
usearchivesdoc->setFixedSize(WS,HS); //设置窗体大小
useoutbound->move(WM,HM); //移动位置
useoutbound->setFixedSize(WS,HS); //设置窗体大小
useinventory->move(WM,HM); //移动位置
useinventory->setFixedSize(WS,HS); //设置窗体大小
usefileexport->move(WM,HM); //移动位置
usefileexport->setFixedSize(WS,HS); //设置窗体大小
usestatistical->move(WM,HM); //移动位置
usestatistical->setFixedSize(WS,HS); //设置窗体大小
useusermanagement->move(WM,HM); //移动位置
useusermanagement->setFixedSize(WS,HS); //设置窗体大小
useorganizationmangement->move(WM,HM); //移动位置
useorganizationmangement->setFixedSize(WS,HS); //设置窗体大小
QWidget::resizeEvent(event);
}
void cd::on_pushButton_newdoc_clicked()// 1
{
usenewdoc->show();
usearchivesdoc->hide();
useoutbound->hide();
useinventory->hide();
usefileexport->hide();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->hide();
}
void cd::on_pushButton_archiveManagement_clicked()// 2
{
usenewdoc->hide();
usearchivesdoc->show();
useoutbound->hide();
useinventory->hide();
usefileexport->hide();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->hide();
}
void cd::on_pushButton_outbound_clicked()// 3
{
usenewdoc->hide();
usearchivesdoc->hide();
useoutbound->show();
useinventory->hide();
usefileexport->hide();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->hide();
}
void cd::on_pushButton_inventory_clicked()// 4
{
usenewdoc->hide();
usearchivesdoc->hide();
useoutbound->hide();
useinventory->show();
usefileexport->hide();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->hide();
}
void cd::on_pushButton_export_clicked()// 5
{
usenewdoc->hide();
usearchivesdoc->hide();
useoutbound->hide();
useinventory->hide();
usefileexport->show();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->hide();
}
void cd::on_pushButton_Statistical_clicked()// 6
{
usenewdoc->hide();
usearchivesdoc->hide();
useoutbound->hide();
useinventory->hide();
usefileexport->hide();
usestatistical->show();
useusermanagement->hide();
useorganizationmangement->hide();
}
void cd::on_pushButton_userManagement_clicked()// 7
{
if(LandingRole!="管理员")
{
QMessageBox::information(this,"警告!","您不是管理员!");
//return;
}
usenewdoc->hide();
usearchivesdoc->hide();
useoutbound->hide();
useinventory->hide();
usefileexport->hide();
usestatistical->hide();
useusermanagement->show();
useorganizationmangement->hide();
}
void cd::on_pushButton_OrganizationMangement_clicked()// 8
{
usenewdoc->hide();
usearchivesdoc->hide();
useoutbound->hide();
useinventory->hide();
usefileexport->hide();
usestatistical->hide();
useusermanagement->hide();
useorganizationmangement->show();
}