迁移主窗口的背景色到qss文件中
This commit is contained in:
parent
bbc85f17b3
commit
84e020c26e
@ -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);}
|
||||
/*---未生效*/
|
||||
|
Binary file not shown.
@ -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()<<btnName <<endl;
|
||||
|
||||
if(btnName.compare("EEG") == 0)
|
||||
if(btnName.compare("EEG",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_stackWidget.addWidget(&m_Egg);
|
||||
m_stackWidget.setCurrentWidget(&m_Egg);
|
||||
|
||||
}
|
||||
else if(btnName.compare("DataProcess") == 0)
|
||||
else if(btnName.compare("DataProcess",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_stackWidget.addWidget(&m_DataProcess);
|
||||
m_stackWidget.setCurrentWidget(&m_DataProcess);
|
||||
}
|
||||
else if(btnName.compare("SystemSetting") == 0)
|
||||
else if(btnName.compare("SystemSetting",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_stackWidget.addWidget(&m_SystemSetting);
|
||||
m_stackWidget.setCurrentWidget(&m_SystemSetting);
|
||||
|
@ -5,6 +5,14 @@
|
||||
#include "systemsettingwidget.h"
|
||||
#include "dataprocesswidget.h"
|
||||
#include "eggwidget.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QStyleOption>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
|
||||
|
||||
|
||||
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:
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user