#include "mainwindow.h"
#include <QApplication>
#include <QMessageBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QGridLayout>
#include <QWidget>
#include <QLineEdit>
#include <QTextEdit>
#include <QAction>
#include <QPushButton>
#include <QMenuBar>
#include <QPainter>
#include <QComboBox>
int main(int argc
, char *argv
[])
{
QApplication
a(argc
, argv
);
QWidget w2
;
w2
.setWindowTitle("编辑资料");
w2
.setWindowIcon(QIcon(":/images/doc-01"));
QLabel
base("基础信息");
QLabel
username("昵 称");
username
.adjustSize();
username
.setStyleSheet("color:Gray");
username
.setParent(&w2
);
QLineEdit input_name
;
QLabel
sex("性 别");
sex
.setStyleSheet("color:Gray");
QComboBox input_sex
;
input_sex
.addItem("男");
input_sex
.addItem("女");
input_sex
.addItem("保密");
QLabel
birthday("生 日");
birthday
.setStyleSheet("color:Gray");
QLineEdit input_birthday
;
QLabel
blood("血 型");
blood
.setStyleSheet("color:Gray");
QComboBox input_blood
;
input_blood
.addItem("其他血型");
input_blood
.addItem("A型");
input_blood
.addItem("B型");
input_blood
.addItem("AB型");
input_blood
.addItem("O型");
QLabel
individuality("签 名");
individuality
.setStyleSheet("color:Gray");
QTextEdit textEdit
;
textEdit
.setMaximumHeight(90);
QLabel
education_experience("填写教育经历发现校友");
QLabel
input_education_experience("+添加教育经历");
input_education_experience
.setStyleSheet("color:#1E90FF");
QLabel
No_education_experience("尚未添加教育经历");
No_education_experience
.setStyleSheet("color:Gray");
QLabel
more_base("更多资料");
QLabel
profession("职 业");
profession
.setStyleSheet("color:Gray");
QComboBox input_profession
;
input_profession
.addItem("其他");
QLabel
company("公 司");
company
.setStyleSheet("color:Gray");
QLineEdit
input_company("");
QLabel
region("地 区");
region
.setStyleSheet("color:Gray");
QLineEdit
input_region("中国 湖南 张家界 慈利县");
QLabel
hometown("故 乡");
hometown
.setStyleSheet("color:Gray");
QLineEdit
input_hometown("爱沙尼亚 贝尔瓦");
QLabel
phone("手 机");
phone
.setStyleSheet("color:Gray");
QLineEdit
input_phone("1111");
QLabel
email("邮 箱");
email
.setStyleSheet("color:Gray");
QLineEdit
input_email("11111@qq.com");
QLabel
personal_description("个人说明");
personal_description
.setStyleSheet("color:Gray");
QTextEdit input_personal_description
;
input_personal_description
.setMaximumHeight(90);
QLabel
images("图 标");
images
.setStyleSheet("color:Gray");
QPushButton image_one
,image_two
,image_three
;
QIcon
ico_one(":/images/doc-01"),ico_two(":/images/doc-02"),ico_three(":/images/doc-03");
image_one
.setIcon(ico_one
);
image_one
.setIconSize(QSize(40,40));
image_one
.setStyleSheet("border:none");
image_two
.setIcon(ico_two
);
image_two
.setIconSize(QSize(40,40));
image_two
.setStyleSheet("border:none");
image_three
.setIcon(ico_three
);
image_three
.setIconSize(QSize(40,40));
image_three
.setStyleSheet("border:none");
QImage
image(QString(":/images/doc-01"));
QLabel
management("管理");
management
.setStyleSheet("color:#1E90FF");
QPushButton
save("保持");
QPushButton
quit("关闭");
QGridLayout glayout
,images_button_glayout
;
glayout
.addWidget(&base
,0,0);
QFrame
*spilterLine
= new QFrame();
spilterLine
->setFixedSize(580, 3);
spilterLine
->setFrameShape(QFrame
::HLine
);
spilterLine
->setFrameShadow(QFrame
::Sunken
);
glayout
.addWidget(spilterLine
,1,0);
glayout
.addWidget(&username
,2,0);
glayout
.addWidget(&input_name
,2,1,1,1);
glayout
.addWidget(&sex
,2,2);
glayout
.addWidget(&input_sex
,2,3);
glayout
.addWidget(&birthday
,3,0);
glayout
.addWidget(&input_birthday
,3,1,1,1);
glayout
.addWidget(&blood
,3,2);
glayout
.addWidget(&input_blood
,3,3,1,1);
glayout
.addWidget(&individuality
,4,0,1,1);
glayout
.addWidget(&textEdit
,4,1,1,3);
glayout
.addWidget(&education_experience
,5,0);
glayout
.addWidget(&input_education_experience
,5,3);
QFrame
*spilterLine2
= new QFrame();
spilterLine2
->setFixedSize(580, 3);
spilterLine2
->setFrameShape(QFrame
::HLine
);
spilterLine2
->setFrameShadow(QFrame
::Sunken
);
glayout
.addWidget(spilterLine2
,6,0);
glayout
.addWidget(&No_education_experience
,7,2,1,1);
glayout
.addWidget(&more_base
,8,0,1,1);
QFrame
*spilterLine3
= new QFrame();
spilterLine3
->setFixedSize(580, 3);
spilterLine3
->setFrameShape(QFrame
::HLine
);
spilterLine3
->setFrameShadow(QFrame
::Sunken
);
glayout
.addWidget(spilterLine3
,9,0);
glayout
.addWidget(&profession
,10,0,1,1);
glayout
.addWidget(&input_profession
,10,1,1,3);
glayout
.addWidget(&company
,11,0,1,1);
glayout
.addWidget(&input_company
,11,1,1,3);
glayout
.addWidget(®ion
,12,0);
glayout
.addWidget(&input_region
,12,1,1,3);
glayout
.addWidget(&hometown
,13,0);
glayout
.addWidget(&input_hometown
,13,1,1,3);
glayout
.addWidget(&phone
,14,0);
glayout
.addWidget(&input_phone
,14,1,1,3);
glayout
.addWidget(&email
,15,0);
glayout
.addWidget(&input_email
,15,1,1,3);
glayout
.addWidget(&personal_description
,16,0);
glayout
.addWidget(&input_personal_description
,16,1,1,3);
glayout
.addWidget(&images
,17,0);
images_button_glayout
.addWidget(&image_one
,0,1);
images_button_glayout
.addWidget(&image_two
,0,2);
images_button_glayout
.addWidget(&image_three
,0,3);
glayout
.addWidget(&management
,17,4);
glayout
.addWidget(&save
,18,3);
glayout
.addWidget(&quit
,18,4);
QHBoxLayout
*layout
= new QHBoxLayout
;
glayout
.setSpacing(10);
glayout
.setMargin(10);
glayout
.addLayout(&images_button_glayout
,17,1);
layout
->addLayout(&glayout
);
w2
.setLayout(layout
);
w2
.setFixedSize(800,1300);
w2
.show();
return a
.exec();
}