18
/*
渐变色:从左到右,黑白渐变
*/
19
QComboBox:!editable,QComboBox::drop-
down:editable {
20
background:qlineargradient(x1:
0
, y1:
0
, x2:
1
, y2:
0
,
21
stop:
0
rgb(
0
,
0
,
0
), stop:
1
rgb(
255
,
255
,
255
));
22
}
24
/*
当下拉框打开时,背景颜色渐变
*/
25
QComboBox:!editable:on, QComboBox::drop-
down:editable:on {
26
background: qlineargradient(x1:
0
, y1:
0
, x2:
1
, y2:
0
,
27
stop:
0
#D3D3D3, stop:
0.4
#D8D8D8,
28
stop:
0.5
#DDDDDD, stop:
1.0
#BBBBBB);
29
}
31
/*
当下拉框打开时, 移动显示框文本位置
*/
32
QComboBox:on {
33
padding-
top: 3px;
34
padding-
left: 4px;
35
}
37
/*
下拉按钮
*/
38
QComboBox::drop-
down {
39
subcontrol-
origin: padding;
41
/*
按钮位置,右上角
*/
42
subcontrol-
position: top right;
44
/*
按钮宽度
*/
45
width: 25px;
47
/*
一条边框线控制
*/
48
border-left-
width: 3px;
49
border-left-
color: red;
50
border-left-
style: solid;
52
/*
倒角
*/
53
border-top-right-
radius: 3px;
54
border-bottom-right-
radius: 3px;
55
}
57
/*
下拉按钮图片
*/
58
QComboBox::down-
arrow {
59
border-image: url(:/images/
02
.bmp);
60
}
62
/*
下拉按钮位移
*/
63
QComboBox::down-
arrow:on {
64
top: 1px;
65
left: 1px;
66
}
68
/*
下拉列表里的颜色
*/
69
QComboBox QAbstractItemView {
70
border: 2px solid darkgray;
71
selection-background-
color: green;