QPushButton常用样式
QPushButton
{
color:rgb(255,255,255);
background-color:rgb(39, 100, 255);
border-radius:4px;
opacity: 1.0;
}
QPushButton:pressed
{
color:rgb(255, 255, 255);
background-color:rgb(0, 170, 20);
opacity: 0.5;
}
//QListWidget 常用样式
QListWidget{
border:1px solid gray;
color:black;
outline:0px;
height:40px;
}
QListWidget::Item{
padding-top:4px;
padding-bottom:4px;
min-height:30px;
}
QListWidget::item:selected
{
background:rgb(39, 100, 255);
color:rgb(255, 255, 255);
}
QListWidget::item:!selected
{
color:rgb(0, 0, 0);
background:rgb(255, 255, 255);
}
//QTabWidget 样式
QTabBar::tab {
min-height: 30px;
font-size: 12px;
}
QTabBar::tab:selected {
background:rgb(39, 100, 255);
color: rgb(255, 255, 255);
border-radius:4px;
}
QTabBar::tab:!selected {
background:rgb(255, 255, 255);
color: rgb(0, 0, 0);
}
//QCombobox 样式
QComboBox {
background-color: rgb(255,255,255);
color: rgb(0, 0, 0);
border: 1px solid #333333;
}
QComboBox:editable {
background: white;
}
QComboBox:!editable, QComboBox::drop-down:editable {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
}
/* QComboBox gets the "on" state when the popup is open */
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #D3D3D3, stop: 0.4 #D8D8D8,
stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1);
}
QComboBox:on { /* shift the text when the popup opens */
padding-top: 3px;
padding-left: 4px;
}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
border-left-width: 1px;
border-left-color: darkgray;
border-left-style: solid; /* just a single line */
border-top-right-radius: 3px; /* same radius as the QComboBox */
border-bottom-right-radius: 3px;
}
QComboBox::down-arrow {
image: url(/usr/share/icons/crystalsvg/16x16/actions/1downarrow.png);
}
QComboBox::down-arrow:on { /* shift the arrow when popup is open */
top: 1px;
left: 1px;
}
QSlider 样式
QSlider::groove:horizontal {
border: 0px solid #bbb;
}
QSlider::sub-page:horizontal {
background: rgb(235,97,0);
border-radius: 0px;
margin-top:8px;
margin-bottom:8px;
}
QSlider::add-page:horizontal {
background: rgb(255,255, 255);
border: 0px solid #777;
border-radius: 2px;
margin-top:8px;
margin-bottom:8px;
}
QSlider::handle:horizontal {
background: rgb(255,153,102);
border: 1px solid rgb(255,153,102);
width: 14px;
height:10px;
border-radius: 7px;
margin-top:2px;
margin-bottom:2px;
}
QSlider::handle:horizontal:hover {
background: rgb(255,128,6);
border: 1px solid rgba(102,102,102,102);
border-radius: 7px;
}
QSlider::sub-page:horizontal:disabled {
background: #bbb;
border-color: #999;
}
QSlider::add-page:horizontal:disabled {
background: #eee;
border-color: #999;
}
QSlider::handle:horizontal:disabled {
background: #eee;
border: 1px solid #aaa;
border-radius: 4px;
}