MetroUI
QProgressBar{
text-align:center;//设置文字在中央
color:#fff;//设置文字的颜色
background-color:transparent;//将背景色设置为透明
border: 2px solid #e3a21a;//设置border的width,style,color
border-radius:7px;//设置border的边角半径
font: 75 12pt "Open Sans";//设置字体
}
//显示进度块
QProgressBar::chunk{
background-color:#2d89ef;//进度块的背景色
width:20px;//进度块的宽度
}
QLineEdit{
border-radius:0;//也可以把border设置为0
}
//通过QTabWidget::tab-bar只能控制tabBar的位置
QTabWidget::tab-bar{
left:3px;
}
//通过QTabBar::tab来设置QTabWidget的tabBar
QTabWidget::tab{
background-color:#3d3d3d;
}
QStatusBar{
background-color:#7e3878;//设置背景色
color:#fff;
}
QPushButton{
border-style:solid;//设置border的style
background-color:#3d3d3d;//设置背景色
color:#fff;//设置前景色
border-radius:7px;//边角半径
}
鼠标通过QPushButton时
QPushButton:hover{
color:#ccc;//设置前景色
background-color: qlineargradient(spread:pad, x1:0.517, y1:0, x2:0.517, y2:1, stop:0 rgba(45, 45, 45, 255), stop:0.505682 rgba(45, 45, 45, 255), stop:1 rgba(29, 29, 29, 255));
border-color:#2d89ef;//设置border的颜色
border-width:2px;//设置border的宽度
}
QPushButton被按下的时候
QPushButton:pressed{
background-color: qlineargradient(spread:pad, x1:0.517, y1:0, x2:0.517, y2:1, stop:0 rgba(29, 29, 29, 255), stop:0.505682 rgba(45, 45, 45, 255), stop:1 rgba(29, 29, 29, 255));
}
QListWidget{
background-color:#3d3d3d;
color:#fff;
}
QMainWindow{
background-color:#1d1d1d;
}
//自定义QMenuBar
QMenuBar{
background-color:#1d1d1d;
padding:5px;
font: 12pt "MS Shell Dlg 2";
}
QMenuBar::item{
background-color:#1d1d1d;
color:#fff;
padding:5px;
}
QMenu{
color:#fff;
padding:0;
}
QMenu::item:selected{
color:#fff;
background-color:#00aba9;
}
//自定义QTableWidget
QTableWidget{
background-color:#3d3d3d;
color:#fff;
/*selection-background-color: #da532c;*/
border:solid;
border-width:3px;
border-color:#da532c;
}
//设置QHeaderView,QTableWidget的表头
QHeaderView{
background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(20, 158, 217, 255), stop:1 rgba(36, 158, 217, 255));
border:none;
border-top-style:solid;
border-width:1px;
border-top-color:#149ED9;
color:#fff;
font: 75 12pt "Calibri";
}
//设置QHeaderView的每一项
QHeaderView::section{
background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(20, 158, 217, 255), stop:1 rgba(36, 158, 217, 255));
border:none;
border-top-style:solid;
border-width:1px;
border-top-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(20, 158, 217, 255), stop:1 rgba(36, 158, 217, 255));
color:#fff;
}
//水平跟垂直交汇出的section
QTableCornerButton::section{
border:none;
background-color:#149ED9;
}
MetroUI QSS来自github:https://github.com/TheOpenDevProject/QssUI