我是靠谱客的博主 自然花瓣,这篇文章主要介绍QT软件开发: 设置QSlider样式,现在分享给大家,希望可以做个参考。

示例样式:

ui->horizontalSlider->setStyleSheet("");
/*滑块的样式*/
QSlider::groove:horizontal {
border: 1px solid #00B0AE;
background: #00B0AE;
height: 2px;
border-radius: 1px;
padding-left:0px;
padding-right:0px;
}

/*滑块经过的颜色:前面的颜色*/
QSlider::sub-page:horizontal {
background: #00B0AE;
border: 1px solid #00B0AE;
height: 2px;
border-radius: 2px;
}

QSlider::add-page:horizontal {
background: #EAEAEA;
border: 0px solid #EAEAEA;
height: 2px;
border-radius: 2px;
}
QSlider::handle:horizontal 
{
    background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, 
    stop:0.6 #00B0AE,stop:0.98409 rgba(255, 255, 255, 255));

    width: 15px;
    margin-top: -6px;
    margin-bottom: -6px;
    border-radius: 5px;
}

QSlider::handle:horizontal:hover {
    background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5,

最后

以上就是自然花瓣最近收集整理的关于QT软件开发: 设置QSlider样式的全部内容,更多相关QT软件开发:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(88)

评论列表共有 0 条评论

立即
投稿
返回
顶部