#include "hospitalinfo.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QDebug>
HospitalInfo::HospitalInfo(QWidget * parent ):QWidget (parent)
{
    init();
    initLay();
    initConnect();

}
HospitalInfo::~HospitalInfo()
{

}
void  HospitalInfo::init()
{
    //医院名称
    m_labHospitalName.setText(tr("HospitalName"));

    //科室
    m_labSection.setText(tr("Section"));

    //用户数
    m_labUserNum.setText(tr("UserNum"));;


    //数据库 名称
    m_labDataBaseName.setText(tr("DataBaseName"));

    //用户名
    m_labUser.setText(tr("User"));

    m_labpasswd.setText(tr("Passwd"));


    //确认
    m_btnOK.setText(tr("Confirm"));


}
void  HospitalInfo::initLay()
{

    QGridLayout * gridlaySearch = new QGridLayout;
    QHBoxLayout * hlay   = new QHBoxLayout;
    QVBoxLayout * vlay    = new QVBoxLayout;
    vlay->addLayout(gridlaySearch);
    vlay->addLayout(hlay);

    setLayout(vlay);

    int col = 0;
    int row = 0;
    gridlaySearch->addWidget(&m_labHospitalName,row,col);
    gridlaySearch->addWidget(&m_editHospitalName,row,++col);
    row ++;
    col = 0;
    gridlaySearch->addWidget(&m_labSection,row,col);
    gridlaySearch->addWidget(&m_editSection,row,++col);
    row ++;
    col = 0;
    gridlaySearch->addWidget(&m_labUserNum,row,col);
    gridlaySearch->addWidget(&m_editUserNum,row,++col);

    row ++;
    col = 0;
    gridlaySearch->addWidget(&m_labDataBaseName,row,col);
    gridlaySearch->addWidget(&m_editDataBaseName,row,++col);

    row ++;
    col = 0;
    gridlaySearch->addWidget(&m_labUser,row,col);
    gridlaySearch->addWidget(&m_editUser,row,++col);

    row ++;
    col = 0;
    gridlaySearch->addWidget(&m_labpasswd,row,col);
    gridlaySearch->addWidget(&m_editPasswd,row,++col);

    hlay->addStretch();
    hlay->addWidget(&m_btnOK);
    hlay->addStretch();

}
bool  HospitalInfo::initConnect()
{

}
