-
Notifications
You must be signed in to change notification settings - Fork 0
/
clientinfocollector.cpp
50 lines (47 loc) · 1.41 KB
/
clientinfocollector.cpp
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
#include "clientinfocollector.h"
#include "ui_clientinfocollector.h"
#include <QFileDialog>
#include <QMessageBox>
#include <QProcessEnvironment>
#include <QDesktopWidget>
ClientInfoCollector::ClientInfoCollector(QWidget *parent) :
QDialog(parent),
ui(new Ui::ClientInfoCollector)
{
ui->setupUi(this);
if(QProcessEnvironment::systemEnvironment().value("OS")!=QString("Windows_NT"))
{
QRect applicationGeometry=QApplication::desktop()->availableGeometry();
this->setFixedSize(applicationGeometry.size());
}
}
ClientInfoCollector::~ClientInfoCollector()
{
delete ui;
}
void ClientInfoCollector::on_okButton_clicked()
{
if(ui->nicknameInput->text().length()==0)
{
QMessageBox::warning(this,tr("错误"),tr("请填写昵称"));
return;
}
if(ui->incomeInput->text().length()==0)
{
QMessageBox::warning(this,tr("错误"),tr("请填写月收入"));
return;
}
if(ui->educationInput->text().length()==0)
{
QMessageBox::warning(this,tr("错误"),tr("请填写学历"));
return;
}
if(ui->ageEdit->text().length()==0)
{
QMessageBox::warning(this,tr("错误"),tr("请填写年龄"));
return;
}
emit data(ui->nicknameInput->text(),ui->sexInput->currentText()=="男"?true:false,
ui->incomeInput->text().toInt(),ui->educationInput->text(),ui->ageEdit->text().toInt());
accept();
}