diff --git a/bin/defaultstyle.qss b/bin/defaultstyle.qss index 526cb58..0107d91 100644 --- a/bin/defaultstyle.qss +++ b/bin/defaultstyle.qss @@ -1,12 +1,12 @@ -/*title对应的qss*/ -QWidget#title{background-color:#ffffff;} +/*title对应的qss 以及主窗口framewindows的背景*/ +QWidget#title,#FrameWindow{background-color:#ffffff;} QLabel#titleDes{font-size: 45px;font-weight: 500;font-family: 思源黑体;color:#0D9DDB;background-color: transparent;} QLabel#titleSystemName{font-size: 45px;font-weight: 500;font-family: 思源黑体;color:#555555;background-color: transparent;} QPushButton#titleBtn{border-image:url(:/image/icon_exit.png);border-radius: 40px;background-color: #EEF7FD;} QPushButton#titleBtn:hover{border-image:url(:/image/icon_exit_hover.png);border-radius: 40px; background-color:green;} QPushButton#titleBtn:pressed{border-image:url(:/image/icon_exit_checked.png);border-radius: 40px;background-color: blue;} /*mainBtn*/ -MainBtn{border-image:url(:/image/index_bg_setting.png);} +MainBtn{border-image:url(:/image/index_bg_setting.png);background-color: transparent;} MainBtn:hover{border-image:url(:/image/index_bg_setting_hover.png);} MainBtn:pressed{border-image:url(:/image/index_bg_setting_checked.png);} /*---未生效*/ diff --git a/bin/xyylMCWEACSystem.exe b/bin/xyylMCWEACSystem.exe index aec66df..99d1296 100644 Binary files a/bin/xyylMCWEACSystem.exe and b/bin/xyylMCWEACSystem.exe differ diff --git a/xyylMCWEACSystem/framewindow.cpp b/xyylMCWEACSystem/framewindow.cpp index 6137253..dddcb10 100644 --- a/xyylMCWEACSystem/framewindow.cpp +++ b/xyylMCWEACSystem/framewindow.cpp @@ -23,7 +23,7 @@ void FrameWindow::init() m_stackWidget.setCurrentWidget(&m_MainWindow); setWindowTitle(" "); setObjectName("FrameWindow"); - this->setStyleSheet("QWidget{background-color:#ffffff;}"); + } @@ -68,18 +68,18 @@ void FrameWindow::slotClickedChanged(QString btnName) { qDebug()< +#include +#include +#include + + + class FrameWindow:public QWidget { Q_OBJECT @@ -15,6 +23,14 @@ public: void init(); void initLay(); bool initConnect(); + void paintEvent(QPaintEvent* event) + { + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + } + private slots: void slotClickedChanged(QString); private: diff --git a/xyylMCWEACSystem/main.cpp b/xyylMCWEACSystem/main.cpp index 0b16475..b8cf198 100644 --- a/xyylMCWEACSystem/main.cpp +++ b/xyylMCWEACSystem/main.cpp @@ -45,10 +45,6 @@ int main(int argc, char *argv[]) QApplication::setFont(globalFont); LoadStyleFile(QApplication::applicationDirPath()+"/defaultstyle.qss"); #endif - MainBtn ll,ll2; - ll.setTxt("系统设置","EGG acquisition","data"); - ll2.setTxt("系统设置","setup","setup"); - ll.show(); - ll2.show(); + return a.exec(); } diff --git a/xyylMCWEACSystem/mainbtn.cpp b/xyylMCWEACSystem/mainbtn.cpp index 507519b..b77c9dd 100644 --- a/xyylMCWEACSystem/mainbtn.cpp +++ b/xyylMCWEACSystem/mainbtn.cpp @@ -19,16 +19,13 @@ MainBtn::MainBtn(QPushButton * parent ):QPushButton (parent) #if 0 this->setStyleSheet("QPushButton{border-image:url(:/image/index_bg_setting.png);}" "QPushButton:hover{border-image:url(:/image/index_bg_setting_hover.png);}" - "QPushButton:pressed{border-image:url(:/image/index_bg_setting_checked.png);}" - - ); + "QPushButton:pressed{border-image:url(:/image/index_bg_setting_checked.png);}" ); m_labTxt.setStyleSheet("font-size: 60px;font-weight: 500;color:white;background-color:transparent;"); - m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;background-color:transparent;"); + m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;background-color:transparent;"); #endif - m_labTxt.setStyleSheet("font-size: 60px;font-weight: 500;color:white;background-color:transparent;"); - m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;background-color:transparent;"); - // m_labTxt.setStyleSheet("QLabel#MainTxt{font-size: 60px;font-weight: 500;color:white;background-color: transparent;}"); - // m_labEgTxt.setStyleSheet("QLabel#MainTxtEn{font-size: 60px;font-weight:normal;color:white;background-color: transparent;}"); + + m_labTxt.setStyleSheet("font-size: 60px;font-weight: 500;color:white;background-color:transparent;"); + m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;background-color:transparent;"); #if 1 m_labTxt.setFixedSize(QSize(240,87));