Qt 滚动条美化
# 设置verticalScrollBar()的样式
ui->listWidget_3->verticalScrollBar()->setStyleSheet("QScrollArea{border:0px solid;"
"border-radius: 5px;}"
"QScrollBar:vertical{width: 10px;border:0px solid;"
"border-radius: 5px;margin: 0px,0px,0px,0px;"
""> transparent;background:#e1f0fa;}"
"QScrollBar:vertical:hover{width: 10px;"
"border:0px solid;margin: 0px,0px,0px,0px;background:#e1f0fa;}"
"QScrollBar::handle:vertical{width:10px;background:#c0ddee;"
"border-radius: 5px;height: 40px;}"
"QScrollBar::handle:vertical:hover{background:#c0ddee;"
"border-radius: 5px;}"
"QScrollBar::add-line:vertical{height:11px;"> transparent;"
"subcontrol-position:bottom;border:0px solid;"
"border-radius: 5px;}"
"QScrollBar::sub-line:vertical{height:11px;"
""> transparent;subcontrol-position:top;"
"border:0px solid;border-radius: 5px;}"
"QScrollBar::add-page:vertical{"> #e1f0fa;"
"border:0px solid;border-radius: 5px;}"
"QScrollBar::sub-page:vertical{"> #e1f0fa;"
"border:0px solid;border-radius: 5px;}"
"QScrollBar::up-arrow:vertical{"
"border:0px solid;border-radius: 3px;}"
"QScrollBar::down-arrow:vertical {"
"border:0px solid;border-radius: 3px;}");
# 效果
颜色粗细什么的,根据自己需要修改一下就可以了。