uppdate: 调整主窗口布局、样式匹配
This commit is contained in:
parent
9cb6c46903
commit
a108e6ea88
@ -20,7 +20,8 @@ void FrameWindow::init()
|
||||
m_stackWidget.addWidget(&m_MainWindow);
|
||||
m_stackWidget.setCurrentWidget(&m_MainWindow);
|
||||
|
||||
|
||||
setObjectName("FrameWindow");
|
||||
this->setStyleSheet("QWidget{background-color:#ffffff;}");
|
||||
|
||||
|
||||
}
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include "DevConWidget.h"
|
||||
#include "framewindow.h"
|
||||
#include <QStackedWidget>
|
||||
|
||||
#include "navlistwidget.h"
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
@ -42,9 +44,15 @@ int main(int argc, char *argv[])
|
||||
FrameWindow mainw;
|
||||
mainw.resize(1000,800);
|
||||
mainw.show();
|
||||
|
||||
a.setStyleSheet("QWidget{background-color:#ffffff;}");
|
||||
#if 0
|
||||
//a.setStyleSheet("QWidget{background-color:#ffffff;}");
|
||||
a.setStyleSheet("QWidget{background: rgb(47, 61, 82);}");
|
||||
QFont globalFont;
|
||||
globalFont.setFamily("黑体");
|
||||
QApplication::setFont(globalFont);
|
||||
NavListWidget nav;
|
||||
nav.setList(QStringList()<<"填写病历"<<"病历管理"<<"导联方案",QStringList()<<"ssss"<<"sss"<<"sk");
|
||||
nav.show();
|
||||
#if 1
|
||||
DevConWidget de;
|
||||
de.show();
|
||||
|
||||
@ -60,8 +68,7 @@ me.show();
|
||||
MedicalRecordWidget mew;
|
||||
mew.show();
|
||||
|
||||
RegWidget re;
|
||||
re.show();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
99
xyylMCWEACSystem/navlistwidget.cpp
Normal file
99
xyylMCWEACSystem/navlistwidget.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
#include "navlistwidget.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QGridLayout>
|
||||
#include <QDebug>
|
||||
#include <QButtonGroup>
|
||||
NavListWidget::NavListWidget(QFrame * parent )
|
||||
{
|
||||
init();
|
||||
initLay();
|
||||
initConnect();
|
||||
setObjectName("NavList");
|
||||
}
|
||||
NavListWidget::~NavListWidget( )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void NavListWidget::init()
|
||||
{
|
||||
|
||||
}
|
||||
void NavListWidget::initLay()
|
||||
{
|
||||
|
||||
}
|
||||
bool NavListWidget::initConnect()
|
||||
{
|
||||
|
||||
}
|
||||
void NavListWidget::onButtonClicked( QAbstractButton *button)
|
||||
{
|
||||
|
||||
if(button == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug()<< button->objectName()<<endl;
|
||||
}
|
||||
void NavListWidget::setList(QStringList strlist,QStringList strlistObjectName)
|
||||
{
|
||||
|
||||
QVBoxLayout * vlay = new QVBoxLayout;
|
||||
QGridLayout * gridlay = new QGridLayout;
|
||||
vlay->addLayout(gridlay);
|
||||
vlay->addStretch();
|
||||
setLayout(vlay);
|
||||
QButtonGroup *pButtonGroup = new QButtonGroup(this);
|
||||
|
||||
// 设置互斥
|
||||
pButtonGroup->setExclusive(true);
|
||||
|
||||
|
||||
bool ok = connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||
|
||||
|
||||
|
||||
|
||||
for (int i =0;i<strlist.size();i++)
|
||||
{
|
||||
QPushButton *btn = new QPushButton(strlist.at(i));
|
||||
btn->setObjectName(strlistObjectName.at(i));
|
||||
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
pButtonGroup->addButton(btn);
|
||||
btn->setFixedSize(QSize(200,60));
|
||||
// btn->setMinimumSize(QSize(200,80));
|
||||
//btn->setMaximumSize(QSize(200,180));
|
||||
btn->setCheckable(true);
|
||||
gridlay->addWidget( btn);
|
||||
gridlay->setSpacing(0);
|
||||
|
||||
}
|
||||
//#263749
|
||||
|
||||
setStyleSheet("QPushButton{\
|
||||
background: rgb(47, 61, 82);\
|
||||
color: white;\
|
||||
border-radius: 30px;\
|
||||
font-size: 16px;\
|
||||
font-weight: bold;\
|
||||
}\
|
||||
QPushButton:hover{\
|
||||
background: rgb(85, 85, 85);\
|
||||
border-radius: 30px;\
|
||||
}\
|
||||
QPushButton:pressed{\
|
||||
background: rgb(80, 80, 80);\
|
||||
border-radius: 30px;\
|
||||
}\
|
||||
QPushButton:checked{\
|
||||
background: #0d9ddb;\
|
||||
border-radius: 30px;\
|
||||
}"\
|
||||
"QWidget#NavList{background-color:rgb(47, 61, 82);}"\
|
||||
);
|
||||
|
||||
}
|
27
xyylMCWEACSystem/navlistwidget.h
Normal file
27
xyylMCWEACSystem/navlistwidget.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef NAVLISTWIDGET_H
|
||||
#define NAVLISTWIDGET_H
|
||||
/*
|
||||
des: 导航列表
|
||||
*/
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
class NavListWidget:public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NavListWidget(QFrame * parent = NULL);
|
||||
virtual ~NavListWidget( );
|
||||
void init();
|
||||
void initLay();
|
||||
bool initConnect();
|
||||
void setList(QStringList strlist,QStringList strlistObjectName);
|
||||
private slots:
|
||||
void onButtonClicked( QAbstractButton *button);
|
||||
private:
|
||||
|
||||
QList<QPushButton*> m_listBtns;
|
||||
};
|
||||
#endif // NAVLISTWIDGET_H
|
@ -17,13 +17,15 @@ SystemSettingWidget::~SystemSettingWidget()
|
||||
|
||||
void SystemSettingWidget::init()
|
||||
{
|
||||
|
||||
setStyleSheet(" background: rgb(47, 61, 82);");
|
||||
m_labDes.setStyleSheet("border-image:url(:/image/systemsetting.png);}");
|
||||
m_btnRet.setStyleSheet("border-image:url(:/image/icon_back_2.png);}");
|
||||
m_labDes.setMaximumSize(QSize(200,30));
|
||||
m_labDes.setMinimumSize(QSize(200,30));
|
||||
m_btnRet.setMaximumSize(QSize(100,30));
|
||||
m_btnRet.setMinimumSize(QSize(100,30));
|
||||
|
||||
m_NavListWidget.setList(QStringList()<<"填写病历"<<"病历管理"<<"导联方案",QStringList()<<"ssss"<<"sss"<<"sk");
|
||||
}
|
||||
void SystemSettingWidget::initLay()
|
||||
{
|
||||
@ -34,9 +36,17 @@ void SystemSettingWidget::initLay()
|
||||
|
||||
QVBoxLayout * vlay = new QVBoxLayout;
|
||||
vlay->addLayout(hlay,1);
|
||||
vlay->addWidget(new QWidget,9);
|
||||
QWidget * w = new QWidget;
|
||||
vlay->addWidget(w,9);
|
||||
vlay->setContentsMargins(0,0,0,0);
|
||||
setLayout(vlay);
|
||||
|
||||
QHBoxLayout * hlayMain = new QHBoxLayout;
|
||||
|
||||
w ->setLayout(hlayMain);
|
||||
hlayMain->addWidget(&m_NavListWidget,1);
|
||||
hlayMain->addWidget(&m_stackedWidget,9);
|
||||
|
||||
}
|
||||
bool SystemSettingWidget::initConnect()
|
||||
{
|
||||
|
@ -4,7 +4,8 @@
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
#include <QStackedWidget>
|
||||
#include "navlistwidget.h"
|
||||
class SystemSettingWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -18,11 +19,16 @@ signals:
|
||||
void SigClicked(QString objName);
|
||||
private slots:
|
||||
void slotClickedChanged();
|
||||
|
||||
|
||||
private:
|
||||
//< 返回
|
||||
QPushButton m_btnRet;
|
||||
//描述
|
||||
QLabel m_labDes;
|
||||
|
||||
NavListWidget m_NavListWidget;
|
||||
QStackedWidget m_stackedWidget;
|
||||
|
||||
};
|
||||
#endif // SYSTEMSETTINGWIDGET_H
|
||||
|
@ -16,6 +16,7 @@ TitleWidget::~TitleWidget()
|
||||
|
||||
void TitleWidget::init()
|
||||
{
|
||||
setStyleSheet("QWidget{background-color:#ffffff;}");
|
||||
m_labDes.setStyleSheet("border-image:url(:/image/sunnyou_logo.png);}");
|
||||
// m_labSystemName.setStyleSheet("border-image:url(:/image/index_bg_EEG_char.png);}");
|
||||
//m_labSystemName.setText(tr("Multi-channel wireless EEG acquisition system"));
|
||||
|
@ -37,6 +37,7 @@ SOURCES += \
|
||||
mainwindow.cpp \
|
||||
medicalrecordmanager.cpp \
|
||||
medicalrecordwidget.cpp \
|
||||
navlistwidget.cpp \
|
||||
regwidget.cpp \
|
||||
systemsettingwidget.cpp \
|
||||
titlewidget.cpp \
|
||||
@ -55,6 +56,7 @@ HEADERS += \
|
||||
medicalrecordmanager.h \
|
||||
medicalrecordwidget.h \
|
||||
mrmanagement.h \
|
||||
navlistwidget.h \
|
||||
regwidget.h \
|
||||
systemsettingwidget.h \
|
||||
titlewidget.h \
|
||||
|
Loading…
x
Reference in New Issue
Block a user