医院信息布局

This commit is contained in:
work-zym\zhangyiming 2024-11-14 16:33:39 +08:00
parent c7deb85b31
commit 19fd6cd93b
4 changed files with 134 additions and 19 deletions

Binary file not shown.

View File

@ -16,33 +16,139 @@ HospitalInfo::~HospitalInfo()
} }
void HospitalInfo::init() void HospitalInfo::init()
{ {
m_labHospitalInfo.setText("医院信息");;
m_labHospitalInfo.setStyleSheet("QLabel { font-size: 14px;\
color: rgb(13,157,219); }\
");
m_labStart1.setText("*");
m_labStart2.setText("*");
m_labStart1.setFixedWidth(10);
m_labStart2.setFixedWidth(10);
m_labStart1.setStyleSheet("color:red");
m_labStart2.setStyleSheet("color:red");
//医院名称 //医院名称
m_labHospitalName.setText(tr("HospitalName")); m_labHospitalName.setText("医院名称");
//科室 //科室
m_labSection.setText(tr("Section")); m_labSection.setText("科室");;
//用户数 //用户
m_labUserNum.setText(tr("UserNum"));; m_labUserNum.setText("用户人数");;
//数据库 名称 //数据名称
m_labDataBaseName.setText(tr("DataBaseName")); m_labDataBaseName.setText("数据名称");;
//用户名
m_labUser.setText(tr("User"));
m_labpasswd.setText(tr("Passwd")); //用户名称
m_labUser.setText("用户名称");
//用户名称
m_labpasswd.setText("用户密码");;
//确认密码
m_labRepasswd.setText("确认密码");;
//确认 //确认
m_btnOK.setText(tr("Confirm")); m_btnOK.setText("确认");;
m_btnCancel.setText("取消");;
int iwidth = QFontMetrics(this->font()).width("医院名称");
//医院名称
m_labHospitalName.setFixedWidth(iwidth);
//科室
m_labSection.setFixedWidth(iwidth);
//用户人数
m_labUserNum.setFixedWidth(iwidth+10);
//数据名称
m_labDataBaseName.setFixedWidth(iwidth+10);
//用户名称
m_labUser.setFixedWidth(iwidth+10);
//用户名称
m_labpasswd.setFixedWidth(iwidth+10);
//确认密码
m_labRepasswd.setFixedWidth(iwidth+10);
//确认
m_btnOK.setText("确认");;
m_btnCancel.setText("取消");;
} }
void HospitalInfo::initLay() void HospitalInfo::initLay()
{ {
QHBoxLayout * hlay0 = new QHBoxLayout;
hlay0->addWidget(&m_labHospitalInfo);
QHBoxLayout * hlay = new QHBoxLayout;
hlay->addWidget(&m_labStart2);
hlay->addWidget(&m_labHospitalName);
hlay->addWidget(&m_editHospitalName);
hlay->addWidget(&m_labUser);
hlay->addWidget(&m_editUser);
//科室
QHBoxLayout * hlay1 = new QHBoxLayout;
hlay1->addWidget(&m_labStart1);
hlay1->addWidget(&m_labSection);//
hlay1->addWidget(&m_editSection);
hlay1->addWidget(&m_labpasswd);
hlay1->addWidget(&m_editPasswd);
//用户人数
QHBoxLayout * hlay2 = new QHBoxLayout;
hlay2->addWidget(&m_labUserNum);
hlay2->addWidget(&m_editUserNum);
hlay2->addWidget(&m_labRepasswd);
hlay2->addWidget(&m_editRePasswd);
//数据名称
QHBoxLayout * hlay3 = new QHBoxLayout;
hlay3->addWidget(&m_labDataBaseName);
hlay3->addWidget(&m_editDataBaseName);
QHBoxLayout * hlay4 = new QHBoxLayout;
hlay4->addStretch();
hlay4->addWidget(&m_btnOK);
hlay4->addWidget(&m_btnCancel);
hlay4->addStretch();
QVBoxLayout * vlay = new QVBoxLayout;
vlay->addLayout(hlay0);
vlay->addLayout(hlay);
vlay->addLayout(hlay1);
vlay->addLayout(hlay2);
vlay->addLayout(hlay3);
hlay0->setSpacing(0);
hlay->setSpacing(0);
hlay1->setSpacing(0);
hlay2->setSpacing(0);
hlay3->setSpacing(0);
hlay4->setSpacing(0);
setLayout(vlay);
#if 0
QGridLayout * gridlaySearch = new QGridLayout; QGridLayout * gridlaySearch = new QGridLayout;
QHBoxLayout * hlay = new QHBoxLayout; QHBoxLayout * hlay = new QHBoxLayout;
QVBoxLayout * vlay = new QVBoxLayout; QVBoxLayout * vlay = new QVBoxLayout;
@ -82,6 +188,7 @@ void HospitalInfo::initLay()
hlay->addStretch(); hlay->addStretch();
hlay->addWidget(&m_btnOK); hlay->addWidget(&m_btnOK);
hlay->addStretch(); hlay->addStretch();
#endif
} }
bool HospitalInfo::initConnect() bool HospitalInfo::initConnect()

View File

@ -18,27 +18,36 @@ public:
void initLay(); void initLay();
bool initConnect(); bool initConnect();
private: private:
//医院信息
QLabel m_labHospitalInfo;
QLabel m_labStart1;
QLabel m_labStart2;
//医院名称 //医院名称
QLabel m_labHospitalName; QLabel m_labHospitalName;
QLineEdit m_editHospitalName; QLineEdit m_editHospitalName;
//科室 //科室
QLabel m_labSection; QLabel m_labSection;
QLineEdit m_editSection; QLineEdit m_editSection;
//用户 //用户
QLabel m_labUserNum; QLabel m_labUserNum;
QLineEdit m_editUserNum; QLineEdit m_editUserNum;
//数据名称 //数据名称
QLabel m_labDataBaseName; QLabel m_labDataBaseName;
QLineEdit m_editDataBaseName; QLineEdit m_editDataBaseName;
//用户名 //用户名
QLabel m_labUser; QLabel m_labUser;
QLineEdit m_editUser; QLineEdit m_editUser;
//用户密码
QLabel m_labpasswd; QLabel m_labpasswd;
QLineEdit m_editPasswd; QLineEdit m_editPasswd;
//确认密码
QLabel m_labRepasswd;
QLineEdit m_editRePasswd;
//确认 //确认
QPushButton m_btnOK; QPushButton m_btnOK;
QPushButton m_btnCancel;
}; };
#endif // HOSPITALINFO_H #endif // HOSPITALINFO_H

View File

@ -58,9 +58,9 @@ int main(int argc, char *argv[])
mekl.show(); mekl.show();
PerWidget kkss; HospitalInfo ho;
kkss.show(); ho.show();
#if 0 #if 1
CurChatWidget w; CurChatWidget w;
w.show(); w.show();
@ -70,8 +70,7 @@ int main(int argc, char *argv[])
DevConWidget de; DevConWidget de;
de.show(); de.show();
HospitalInfo ho;
ho.show();
LoginWidget log; LoginWidget log;
log.show(); log.show();