首页 > 其他 > 详细

QTreeWidget setstylesheet扎(未完待续)

时间:2019-05-27 10:59:47      阅读:253      评论:0      收藏:0      [点我收藏+]

1.open&close小箭头

open&normal

QTreeView::branch:has-children:!has-siblings:closed,

QTreeView::branch:closed:has-children:has-siblings

{

border-image: none;

image: url();

}

open&active(包括hover、pressed)

QTreeView::branch:has-children:!has-siblings:closed:hover,

QTreeView::branch:closed:has-children:has-siblings:hover

{

border-image: none;

image: url();

}

QTreeView::branch:has-children:!has-siblings:closed:pressed,

QTreeView::branch:closed:has-children:has-siblings:pressed

{

border-image: none;

image: url();

}

open&disable

QTreeView::branch:has-children:!has-siblings:closed:disable,

QTreeView::branch:closed:has-children:has-siblings:disable

{

border-image: none;

image: url();

}

closed&normal

QTreeView::branch:open:has-children:!has-siblings,

QTreeView::branch:open:has-children:has-siblings

{

border-image: none;

image: url();

}

closed&active(包括hover、pressed)

QTreeView::branch:open:has-children:!has-siblings:hover,

QTreeView::branch:open:has-children:has-siblings:hover

{

border-image: none;

image: url();

}

QTreeView::branch:open:has-children:!has-siblings:pressed,

QTreeView::branch:open:has-children:has-siblings:pressed

{

border-image: none;

image: url();

}

closed&disable

QTreeView::branch:open:has-children:!has-siblings:disable,

QTreeView::branch:open:has-children:has-siblings:disable

{

border-image: none;

image: url();

}

2.vertical&horizontal scrollbar

QScrollBar:vertical {

background: #FFFFFF;

width: 8px;

margin: 0 0 0 0;}

QScrollBar::handle:vertical {

background: #CCCCCC;

width: 6px;

margin: 0 1px 0 1px;

border: none;}

QScrollBar::add-line:vertical {

background: #CCCCCC;

height: 0px;

subcontrol-position: bottom;

subcontrol-origin: margin;}

QScrollBar::sub-line:vertical {

background: #CCCCCC;

height: 0px;

subcontrol-position: top;

subcontrol-origin: margin;}

QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {

border: 1px solid grey;

width: 3px;

height: 3px;

background: white;}

QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {

background: none;}

3.Tips

(1)setstylesheet 中间加个:可以当作判断条件&&来使用

QTreeWidget setstylesheet扎(未完待续)

原文:https://www.cnblogs.com/fengyaoyao/p/10929284.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!