160 lines
4.9 KiB
C++
160 lines
4.9 KiB
C++
#include "systemsettingwidget.h"
|
|
#include <QHBoxLayout>
|
|
#include <QVBoxLayout>
|
|
#include <QGridLayout>
|
|
#include <QDebug>
|
|
SystemSettingWidget::SystemSettingWidget(QWidget * parent )
|
|
{
|
|
init();
|
|
initLay();
|
|
initConnect();
|
|
//setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);//无边框 置顶
|
|
// setAttribute(Qt::WA_TranslucentBackground);//透明
|
|
// QString styleSheet = "background-color:rgb(47, 61, 82);border:1px solid white";
|
|
// setStyleSheet(styleSheet);
|
|
|
|
}
|
|
SystemSettingWidget::~SystemSettingWidget()
|
|
{
|
|
|
|
}
|
|
|
|
void SystemSettingWidget::init()
|
|
{
|
|
|
|
this->setStyleSheet("QWidget{background: rgb(47, 61, 82);}");
|
|
m_labDes.setText("系统设置");
|
|
m_btnRet.setText("< 返回");
|
|
m_labDes.setStyleSheet("QLabel{width: 330px;height: 58px;font-family:思源黑体;color:#555555;font-size: 40px;font-weight: 500;}");
|
|
m_btnRet.setStyleSheet("QPushButton{width: 160px;height: 31px;font-size: 40px; border:0px ; font-weight: normal;color: #666666;font-family: Source Han Sans;}");
|
|
|
|
|
|
m_NavListWidget.setList(QStringList()<<"填写病例"<<"病例管理"<<"导联方案"<<"参数设置"<<"医院信息",
|
|
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter-setting" << "hospital-information");
|
|
|
|
m_NavListWidget.setStyleSheet("QPushButton{\
|
|
background: rgb(51, 71, 75);\
|
|
color: white;\
|
|
border-radius: 8px;\
|
|
border:0px ; \
|
|
}\
|
|
QPushButton:hover{\
|
|
color: black;\
|
|
background: rgb(85, 85, 85);\
|
|
border-radius: 8px;\
|
|
}\
|
|
QPushButton:pressed{\
|
|
color: black;\
|
|
background: rgb(80, 80, 80);\
|
|
border-radius: 8px;\
|
|
}\
|
|
QPushButton:checked{\
|
|
color: white;\
|
|
background: #0d9ddb;\
|
|
border-radius: 8px;\
|
|
}"\
|
|
"QWidget#NavList1{background-color:rgb(47, 61, 82);}"\
|
|
);
|
|
}
|
|
void SystemSettingWidget::initLay()
|
|
{
|
|
QHBoxLayout * hlay = new QHBoxLayout;
|
|
hlay->addSpacing(35);
|
|
//hlay->setContentsMargins(125,34,34,34);
|
|
hlay->addWidget(&m_btnRet,1,Qt::AlignLeft);
|
|
//hlay->addSpacing(589);
|
|
hlay->addWidget(&m_labDes,9, Qt::AlignHCenter);
|
|
QWidget * w1 = new QWidget;
|
|
//0
|
|
w1->setFixedHeight(80);
|
|
w1->setStyleSheet("QWidget{background-color:#ffffff;width: 1920px;height: 100px;}");
|
|
w1->setLayout(hlay);
|
|
QVBoxLayout * vlay = new QVBoxLayout;
|
|
vlay->addWidget(w1,1);
|
|
QWidget * w = new QWidget;
|
|
//w->setStyleSheet("QWidget{background-color:#ffffff;border:1px solid blcak}");
|
|
w->setStyleSheet("QWidget{background-color:#ffffff;}");
|
|
w->setStyleSheet("QWidget{background: rgb(47, 61, 82);}");
|
|
vlay->addWidget(w,9);
|
|
vlay->setContentsMargins(0,0,0,0);
|
|
vlay->setSpacing(10);
|
|
setLayout(vlay);
|
|
|
|
QHBoxLayout * hlayMain = new QHBoxLayout;
|
|
|
|
w ->setLayout(hlayMain);
|
|
hlayMain->addWidget(&m_NavListWidget,1);
|
|
hlayMain->addWidget(&m_stackedWidget,9);
|
|
hlayMain->setContentsMargins(0,0,0,0);
|
|
|
|
}
|
|
bool SystemSettingWidget::initConnect()
|
|
{
|
|
bool bCon = true;
|
|
bCon = connect(&m_btnRet,SIGNAL(clicked(bool)),this,SLOT(slotClickedChanged()));
|
|
if(!bCon)
|
|
{
|
|
qDebug()<<"connect failed"<<endl;
|
|
|
|
}
|
|
bCon = connect(&m_NavListWidget,SIGNAL(SigClicked(QString)),this,SLOT(slotClickedBtn(QString)));
|
|
if(!bCon)
|
|
{
|
|
qDebug()<<"connect failed"<<endl;
|
|
|
|
}
|
|
return bCon;
|
|
}
|
|
void SystemSettingWidget::slotClickedChanged()
|
|
{
|
|
|
|
QObject * send = static_cast<QObject *>(sender());
|
|
if(send == nullptr)
|
|
{
|
|
return;
|
|
}
|
|
emit SigClicked(send->objectName());
|
|
QString strName = send->objectName();
|
|
qDebug()<<send->objectName()<<endl;
|
|
}
|
|
void SystemSettingWidget::slotClickedBtn(QString strName)
|
|
{
|
|
|
|
|
|
if(strName.compare("fill-in-the-Case")==0)
|
|
{
|
|
m_stackedWidget.addWidget(&m_MedicalRecordWidget);
|
|
m_stackedWidget.setCurrentWidget(&m_MedicalRecordWidget);
|
|
|
|
}
|
|
else if(strName.compare("case-management")==0)
|
|
{
|
|
|
|
m_stackedWidget.addWidget(&m_MedicalRecordManagerWidget);
|
|
m_stackedWidget.setCurrentWidget(&m_MedicalRecordManagerWidget);
|
|
|
|
}//Parameter setting
|
|
else if(strName.compare("Parameter-setting")==0)
|
|
{
|
|
|
|
m_stackedWidget.addWidget(&m_ParameterSettingsWidget);
|
|
m_stackedWidget.setCurrentWidget(&m_ParameterSettingsWidget);
|
|
|
|
}//hospital-information
|
|
else if(strName.compare("hospital-information")==0)
|
|
{
|
|
m_hospitalinformationWidget.slotUpdateShow();
|
|
m_stackedWidget.addWidget(&m_hospitalinformationWidget);
|
|
m_stackedWidget.setCurrentWidget(&m_hospitalinformationWidget);
|
|
|
|
}//m_LeadSchemeWidget
|
|
else if(strName.compare("leading-scheme")==0)
|
|
{
|
|
|
|
m_stackedWidget.addWidget(&m_LeadSchemeWidget);
|
|
m_stackedWidget.setCurrentWidget(&m_LeadSchemeWidget);
|
|
|
|
}
|
|
}
|
|
|