diff --git a/bin/defaultstyle.qss b/bin/defaultstyle.qss index da63331..526cb58 100644 --- a/bin/defaultstyle.qss +++ b/bin/defaultstyle.qss @@ -1,4 +1,18 @@ - +/*title对应的qss*/ +QWidget#title{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:hover{border-image:url(:/image/index_bg_setting_hover.png);} +MainBtn:pressed{border-image:url(:/image/index_bg_setting_checked.png);} +/*---未生效*/ +QLabel#MainTxt{font-size: 60px;font-weight: 500;color:white;background-color: transparent;} +QLabel#MainTxtEn{font-size: 60px;font-weight:normal;color:white;background-color: transparent;} + QLineEdit { border: 1px solid #ABCDA0; diff --git a/bin/xyylMCWEACSystem.exe b/bin/xyylMCWEACSystem.exe index 4af2dba..aec66df 100644 Binary files a/bin/xyylMCWEACSystem.exe and b/bin/xyylMCWEACSystem.exe differ diff --git a/xyylMCWEACSystem/main.cpp b/xyylMCWEACSystem/main.cpp index 881b1a1..0b16475 100644 --- a/xyylMCWEACSystem/main.cpp +++ b/xyylMCWEACSystem/main.cpp @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) QFont globalFont; globalFont.setFamily("黑体"); QApplication::setFont(globalFont); - //LoadStyleFile(QApplication::applicationDirPath()+"/defaultstyle.qss"); + LoadStyleFile(QApplication::applicationDirPath()+"/defaultstyle.qss"); #endif MainBtn ll,ll2; ll.setTxt("系统设置","EGG acquisition","data"); diff --git a/xyylMCWEACSystem/mainbtn.cpp b/xyylMCWEACSystem/mainbtn.cpp index fcce515..507519b 100644 --- a/xyylMCWEACSystem/mainbtn.cpp +++ b/xyylMCWEACSystem/mainbtn.cpp @@ -6,20 +6,30 @@ m_labTxt.setText(str); m_labEgTxt.setText(str2) ; // m_labImage.setText(str3); - setObjectName("MinBtn"); - //this->setStyleSheet("QPushButton#MinBtn{border-image:url(:/image/index_bg_data.png);border-radius: 40px;} "); - 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);}" - ); - 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_labImage.setStyleSheet(QString("QLabel{border-image:url(:/image/%1.png);background-color: transparent;}").arg(str3)); } -MainBtn::MainBtn(QWidget * parent ) +MainBtn::MainBtn(QPushButton * parent ):QPushButton (parent) { - //setWindowFlags(Qt::FramelessWindowHint); // 去掉边框 - // setAttribute(Qt::WA_TranslucentBackground); // 背景透明 + setObjectName("MainBtn"); + + m_labTxt.setObjectName("MainTxt"); + m_labEgTxt.setObjectName("MainTxtEn"); +#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);}" + + ); + 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;"); + #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;}"); + #if 1 m_labTxt.setFixedSize(QSize(240,87)); diff --git a/xyylMCWEACSystem/mainbtn.h b/xyylMCWEACSystem/mainbtn.h index b7f6263..21697de 100644 --- a/xyylMCWEACSystem/mainbtn.h +++ b/xyylMCWEACSystem/mainbtn.h @@ -6,14 +6,23 @@ #include #include #include + + class MainBtn:public QPushButton { Q_OBJECT public: - MainBtn(QWidget * parent =NULL); + MainBtn(QPushButton * parent =NULL); ~MainBtn(); void setTxt(QString str,QString str2,QString str3); // void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) + { + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + } signals: // void clicked(); protected: diff --git a/xyylMCWEACSystem/mainwindow.cpp b/xyylMCWEACSystem/mainwindow.cpp index 6025453..66e231e 100644 --- a/xyylMCWEACSystem/mainwindow.cpp +++ b/xyylMCWEACSystem/mainwindow.cpp @@ -23,10 +23,7 @@ void MainWindow::init() m_btnEEG.setObjectName("EEG"); m_btnDataProcess.setObjectName("DataProcess"); m_CompanyDes.setText("河南翔宇医疗设备股份有限公司"); - QFont font ("Microsoft YaHei", 10, 85); - m_CompanyDes.setFont(font); - m_CompanyDes.setStyleSheet("color:Gray;"); m_btnDataProcess.setTxt("数据处理","Data processing","data"); m_btnEEG.setTxt("脑电采集","EGG acquisition","acq"); m_btnSystemSetting.setTxt("系统设置","Set up","setup"); diff --git a/xyylMCWEACSystem/titlewidget.cpp b/xyylMCWEACSystem/titlewidget.cpp index e75da68..e79b967 100644 --- a/xyylMCWEACSystem/titlewidget.cpp +++ b/xyylMCWEACSystem/titlewidget.cpp @@ -17,24 +17,15 @@ TitleWidget::~TitleWidget() void TitleWidget::init() { - setStyleSheet("QWidget{background-color:#ffffff;}"); + setObjectName("title"); + m_labDes.setText("Sunnyou 翔宇"); + m_labDes.setObjectName("titleDes"); + m_btnRet.setObjectName("titleBtn"); + m_labSystemName.setObjectName("titleSystemName"); m_labSystemName.setText("Sunlink 多通道无线脑电采集系统"); m_labDes.setFixedSize(QSize(360,59)); - m_labDes.setStyleSheet("font-size: 45px;font-weight: 500;font-family: 思源黑体;color:#0D9DDB;background-color: transparent;"); - m_labSystemName.setStyleSheet("font-size: 45px;font-weight: 500;font-family: 思源黑体;color:#555555;background-color: transparent;"); - // 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")); - // m_labSystemName.setStyleSheet("border-image:url(:/image/logo_txt.png);}"); - m_btnRet.setStyleSheet("background-image:url(:/image/icon_exit.png);}"); - m_btnRet.setStyleSheet("QPushButton{border-image:url(:/image/icon_exit.png);border-radius: 40px;background: #EEF7FD;}" - "QPushButton:hover{border-image:url(:/image/icon_exit_hover.png);}" - "QPushButton:pressed{border-image:url(:/image/icon_exit_checked.png);}" - ); - //m_labDes.setMaximumSize(QSize(300,40)); - //m_labSystemName.setFixedSize(QSize(500,40)); m_btnRet.setFixedSize(QSize(89,90)); m_labDes.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);