QTreeWidget setstylesheet扎(未完待续)

Posted fengyaoyao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了QTreeWidget setstylesheet扎(未完待续)相关的知识,希望对你有一定的参考价值。

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扎(未完待续)的主要内容,如果未能解决你的问题,请参考以下文章

悬停时如何更改QTreewidget标题背景

qt 部分控件 setStyleSheet 使用总结

qtreewidget设置正则表达式

如何使QTreeWidget不显示虚线边框

QT中,QTableView鼠标移动到item上时该item所在行的背景颜色变成其他颜色,这要怎么实现

设置 QtreeWidget 高度