//默认未打开样式
QComboBox{
border: 1px solid rgb(0,0,0);
background: rgb(255,255,255);
color:white;
selection-background-color:rgb(125,125,125);
combobox-popup: 0;
}
//下拉框的显示框效果
QComboBox QAbstractItemView{
border:1px solid rgb(255,255,255);
border:2px;
}
QComboBox::item:hover{
background-color:rgb(0,0,0);
}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: center right;
}
QComboBox::down-arrow {
image: url(":/test.png");
width: 15px;
height:15px;
border-radius:5px;
}
QComboBox::down-arrow:on {
top: 0px;
left: 0px;
}
//item 样式
QComboBox QAbstractItemView
{
padding:5px;
background:rgb(51,51,51);
}
QComboBox QAbstractItemView::item
{
margin:1px 0;
padding:5px;
font-size:15px;
background:rgb(60,60,60);
color:#fff;
font-family:"Microsoft YaHei";
}
//滚动条样式
//主体部分
QComboBox QScrollBar::vertical{
width:10px;
background:#cccccc;
border:none;
border-radius:5px;
}
//滑块主体
QComboBox QScrollBar::handle::vertical{
border-radius:5px;
width: 10px;
background:rgb(125,125,125);
}
QComboBox QScrollBar::handle::vertical::hover{
background:rgb(230,230,230);
}
//向上箭头
QComboBox QScrollBar::add-line::vertical{
border:none;
}
//向下箭头
QComboBox QScrollBar::sub-line::vertical{
border:none;
}