const QString QSS_VerticalScrollBar = "" " QScrollBar: Vertical { " // vertical slider overall " max-width: 8px; " " background: #FFFFFF; " // background color " padding-Top: 0px; " // reserve on position (up arrow placement) " padding-bottom: 0px; " // placeholder (positioned down arrow) the " padding-left: 0px; " // left placeholder (appearance) " padding-right: 0px; " // Right placeholder (appearance) " border-left: 0px Solid # d7d7d7;} "// left dividing line ":: handle QScrollBar: Vertical { " // slider style " background: RGBA (196, 84, 13 is,. 1); " // slider Color " border-RADIUS: 4px; " // rounded corners " } " / / slider height of the maximum-height max: 20px; " QScrollBar :: handle: Vertical: hover { " // mouse touch slide style " background: RGBA (196, 84, 13 is,. 1);} " // slider color " QScrollBar the Add-:: Line: Vertical { " // down arrow style " background: URL (: / Images / Resource / Images / Checkout / down.png) Center-NO REPEAT;} " "QScrollBar::sub-line:vertical{"//向上箭头样式 "background:url(:/images/resource/images/checkout/up.png) center no-repeat;}" ""; const QString QSS_HorizentalScrollBar = "" "QScrollBar:horizontal{" "max-height:8px;" "background:#FFFFFF;" "padding-top:0px;" "padding-bottom:0px;" "padding-left:0px;" "padding-right:0px;}" "QScrollBar::handle:horizontal{" "background:rgba(196, 84, 13, 1);" "border-radius:4px;" "}" //min-width:80px; "QScrollBar::handle:horizontal:hover{" "background:rgba(196, 84, 13, 1);}" "QScrollBar::add-line:horizontal{" "background:url(:/images/resource/images/checkout/right.png) center no-repeat;}" "QScrollBar::sub-line:horizontal{" "background:url(:/images/resource/images/checkout/left.png) center no-repeat;}" "";
#include <QScrollBar>
m_listWidget->verticalScrollBar()->setStyleSheet(QSS_VerticalScrollBar);