From 70fee493677712b1116715a53cb3bff00a60c87d Mon Sep 17 00:00:00 2001 From: "work-zym\\zhangyiming" <1131393555@qq.com> Date: Thu, 31 Oct 2024 10:41:55 +0800 Subject: [PATCH] =?UTF-8?q?modfy:=201=20=E8=B0=83=E6=95=B4=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=8C=89=E9=92=AE=E6=8E=A7=E4=BB=B6=20=202=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE=E5=AD=90?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E6=A0=B7=E5=BC=8F=20=203=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BB=E7=AA=97=E5=8F=A3=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xyylMCWEACSystem/framewindow.cpp | 1 + xyylMCWEACSystem/main.cpp | 2 +- xyylMCWEACSystem/mainwindow.cpp | 4 ++-- xyylMCWEACSystem/navlistwidget.cpp | 4 ++-- xyylMCWEACSystem/systemsettingwidget.cpp | 22 ++++++++++++++++------ xyylMCWEACSystem/systemsettingwidget.h | 9 +++++++++ 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/xyylMCWEACSystem/framewindow.cpp b/xyylMCWEACSystem/framewindow.cpp index 2b64ce1..9158f98 100644 --- a/xyylMCWEACSystem/framewindow.cpp +++ b/xyylMCWEACSystem/framewindow.cpp @@ -29,6 +29,7 @@ void FrameWindow::initLay() { QVBoxLayout * vlay = new QVBoxLayout; vlay->addWidget(&m_stackWidget); + vlay->setContentsMargins(0,0,0,0); setLayout(vlay); } diff --git a/xyylMCWEACSystem/main.cpp b/xyylMCWEACSystem/main.cpp index a36242d..5aa1cdf 100644 --- a/xyylMCWEACSystem/main.cpp +++ b/xyylMCWEACSystem/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) mainw.resize(1000,800); mainw.show(); //a.setStyleSheet("QWidget{background-color:#ffffff;}"); - a.setStyleSheet("QWidget{background: rgb(47, 61, 82);}"); + // a.setStyleSheet("QWidget{background: rgb(47, 61, 82);}"); QFont globalFont; globalFont.setFamily("黑体"); QApplication::setFont(globalFont); diff --git a/xyylMCWEACSystem/mainwindow.cpp b/xyylMCWEACSystem/mainwindow.cpp index 2a5a149..f30de38 100644 --- a/xyylMCWEACSystem/mainwindow.cpp +++ b/xyylMCWEACSystem/mainwindow.cpp @@ -77,14 +77,14 @@ void MainWindow::initLay() QVBoxLayout *vLay = new QVBoxLayout; m_titleWidget.setFixedHeight(100); - //hlay->setContentsMargins(150,100,150,100); + hlay->setSpacing(1); vLay->addWidget(&m_titleWidget,1,Qt::AlignTop); vLay->addSpacing(3); vLay->addLayout(hlay,15); - + vLay->setContentsMargins(0,0,0,0); vLay->addWidget(&m_CompanyDes,1,Qt::AlignBottom | Qt::AlignHCenter);//, vLay->addSpacing(30); diff --git a/xyylMCWEACSystem/navlistwidget.cpp b/xyylMCWEACSystem/navlistwidget.cpp index a0e5c46..7e3a27b 100644 --- a/xyylMCWEACSystem/navlistwidget.cpp +++ b/xyylMCWEACSystem/navlistwidget.cpp @@ -69,13 +69,13 @@ bool NavListWidget::initConnect() //btn->setMaximumSize(QSize(200,180)); btn->setCheckable(true); gridlay->addWidget( btn); - gridlay->setSpacing(0); + gridlay->setSpacing(10); } //#263749 setStyleSheet("QPushButton{\ - background: rgb(47, 61, 82);\ + background: rgba(51, 71, 75);\ color: white;\ border-radius: 30px;\ font-size: 16px;\ diff --git a/xyylMCWEACSystem/systemsettingwidget.cpp b/xyylMCWEACSystem/systemsettingwidget.cpp index e41ff8b..1098d8a 100644 --- a/xyylMCWEACSystem/systemsettingwidget.cpp +++ b/xyylMCWEACSystem/systemsettingwidget.cpp @@ -8,6 +8,10 @@ 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() @@ -17,7 +21,7 @@ SystemSettingWidget::~SystemSettingWidget() void SystemSettingWidget::init() { - setStyleSheet(" background: rgb(47, 61, 82);"); + this->setStyleSheet("QWidget{background: rgb(47, 61, 82);border:0px}"); 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)); @@ -25,20 +29,25 @@ void SystemSettingWidget::init() m_btnRet.setMaximumSize(QSize(100,30)); m_btnRet.setMinimumSize(QSize(100,30)); - m_NavListWidget.setList(QStringList()<<"填写病历"<<"病历管理"<<"导联方案",QStringList()<<"ssss"<<"sss"<<"sk"); + m_NavListWidget.setList(QStringList()<<"填写病历"<<"病例管理"<<"导联方案"<<"参数设置"<<"医院信息", + QStringList()<<"ssss"<<"sss"<<"sk"<<"set"<<"info"); } void SystemSettingWidget::initLay() { QHBoxLayout * hlay = new QHBoxLayout; hlay->addWidget(&m_btnRet,1,Qt::AlignLeft); hlay->addWidget(&m_labDes,9, Qt::AlignHCenter); - - + QWidget * w1 = new QWidget; + w1->setFixedHeight(60); + w1->setStyleSheet("QWidget{background-color:#ffffff;}"); + w1->setLayout(hlay); QVBoxLayout * vlay = new QVBoxLayout; - vlay->addLayout(hlay,1); + vlay->addWidget(w1,1); QWidget * w = new QWidget; + w->setStyleSheet("QWidget{background: rgb(47, 61, 82);border:0px}"); vlay->addWidget(w,9); -vlay->setContentsMargins(0,0,0,0); + vlay->setContentsMargins(0,0,0,0); + vlay->setSpacing(10); setLayout(vlay); QHBoxLayout * hlayMain = new QHBoxLayout; @@ -46,6 +55,7 @@ vlay->setContentsMargins(0,0,0,0); w ->setLayout(hlayMain); hlayMain->addWidget(&m_NavListWidget,1); hlayMain->addWidget(&m_stackedWidget,9); + hlayMain->setContentsMargins(0,0,0,0); } bool SystemSettingWidget::initConnect() diff --git a/xyylMCWEACSystem/systemsettingwidget.h b/xyylMCWEACSystem/systemsettingwidget.h index 379a0a4..505a886 100644 --- a/xyylMCWEACSystem/systemsettingwidget.h +++ b/xyylMCWEACSystem/systemsettingwidget.h @@ -6,6 +6,8 @@ #include #include #include "navlistwidget.h" +#include +#include class SystemSettingWidget: public QWidget { Q_OBJECT @@ -15,6 +17,13 @@ public: void init(); void initLay(); bool initConnect(); + void paintEvent(QPaintEvent *) + { + QStyleOption opt; + opt.initFrom(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);//绘制样式 + } signals: void SigClicked(QString objName); private slots: