Qt之QSlider样式表设置

最近,做了一些的的Qt的关于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;

}



Qt之QSlider样式表设置_第1张图片


ui.horizontalSlider_sound->setStyleSheet(“QSlider {max-width:122; 最小宽度:122; border-image:url();} \ 
		                           QSlider :: groove:horizo​​ ntal {background-image:url(:/ res / Resources / bk / soundsliderbk.png); 身高:18px;} \ 
		                           QSlider ::子页面:horizo​​ ntal {background-image:url(:/ res / Resources / bk / soundsliderpos.png); 边框:5px固体透明; border-radius:5px;} \ 
		                           QSlider :: add-page:horizo​​ ntal {background-color:transparent;} \ 
		                           QSlider :: handle:horizo​​ ntal {background-image:url(:/ res / Resources / bk / soundsliderselect.png);宽度:32px;高度:32px; 保证金左:-5px; 边距:-8px; 与容限右:-5px; 边距:-7px;}“);

或者修改下最上面的那个样式表:




你可能感兴趣的:(C,++,QT-C,++,C++)