QSlider 样式

 

 https://doc.qt.io/archives/qt-4.8/stylesheet-examples.html

//下面是设置垂直滚动条的样例

    QString strStyle = QString("  \
                    //设置整体的颜色
QSlider\ {\ background-color: %2;\ min-width:5px;\ max-width:5px;\ border:15px solid %2;\ }\
                   //设置导轨颜色和大小 QSlider::groove:vertical \ {\ background:transparent;\ width:10px;\ }\
                    //设置滑块属性 QSlider::handle:vertical \ {\ height: 16px;\ width: 16px;\ border
-image: url(%1);\ margin: -2 -6px; \ }\
                      //已经滑过的区域 QSlider::add
-page:vertical\ { \ background-color: %3;\ }\
                      //没有滑过的区域 QSlider::sub
-page:vertical \ {\ background-color: %4;\ }\ ").arg(g_strPhotoPath + "/2.png").arg(strBgColor).arg(ScrollBarColor_voicefill) .arg(ScrollBarColor);

 

posted @ 2019-10-24 10:10  cicero  阅读(1837)  评论(0编辑  收藏  举报