码迷,mamicode.com
首页 > 其他好文 > 详细

Qt滚动条样式

时间:2017-09-04 18:57:03      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:手动   16px   horizon   eee   bsp   min   add   pre   line   

Qt手动设置滚动条的qss样式

QScrollBar:vertical {
     width: 16px;
     margin: 16px 0 16px 0;
     background: #dadada;
}

QScrollBar::handle:vertical {
     background: #eeeeee;
     min-height: 16px;
     border-top: 1px solid #ffffff;
     border-bottom: 1px solid #bbbbbb;
}

 QScrollBar::add-line:vertical {
     background: #eeeeee;
     height: 15px;
     subcontrol-position: bottom;
     subcontrol-origin: margin;
     border-top: 1px solid #ffffff;
}

QScrollBar::sub-line:vertical {
     background: #eeeeee;
     height: 15px;
     subcontrol-position: top;
     subcontrol-origin: margin;
     border-bottom: 1px solid #bbbbbb;
}

QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
     background: none;
}


QScrollBar:horizontal {
     height: 16px;
     margin: 0 16px 0 16px;
     background: #dadada;
}

QScrollBar::handle:horizontal {
     background: #eeeeee;
     min-width: 16px;
     border-left: 1px solid #ffffff;
     border-right: 1px solid #bbbbbb;
}

QScrollBar::add-line:horizontal {
     background: #eeeeee;
     width: 15px;
     subcontrol-position: right;
     subcontrol-origin: margin;
     border-left: 1px solid #ffffff;
}

QScrollBar::sub-line:horizontal {
     background: #eee;
     width: 15px;
     subcontrol-position: left;
     subcontrol-origin: margin;
     border-right: 1px solid #bbbbbb;
}

QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
     background: none;
}

 

Qt滚动条样式

标签:手动   16px   horizon   eee   bsp   min   add   pre   line   

原文地址:http://www.cnblogs.com/lucienbao/p/QScrollBar_Qss.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!