一、前言
QSlider样式
二、环境
qt5.7
window8
三、正文
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;
}
QSlider::groove:horizontal {
border: 0px solid #bbb;
}
/*到达水平样式*/
QSlider::sub-page:horizontal {
background: rgb(23,144, 60);/*背景色*/
border-radius: 0px;/*整体圆角*/
border-top-left-radius:10px;/*左上圆角*/
border-bottom-left-radius:10px;/*左下圆角*/
margin-top:0px;/*上距离*/
margin-bottom:0px;/*下距离*/
}
/*未到达水平样式*/
QSlider::add-page:horizontal {
background: rgb(183,171, 171);/*背景色*/
border-radius: 0px;/*整体圆角*/
border-top-right-radius:10px;/*右上圆角*/
border-bottom-right-radius:10px;/*右下圆角*/
margin-top:0px;/*上距离*/
margin-bottom:0px;/*下距离*/
}
/*拖拽键样式*/
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::sub-page:horizontal:disabled {
}
/*未到达水平样式,失能*/
QSlider::add-page:horizontal:disabled {
}
/*拖拽键样式,失能*/
QSlider::handle:horizontal:disabled {
}
四、结语
over