Qt常用样式表-QTreeWidget/QTreeView

树形列表QTreeView/QTreeWidget

1 列表分支展开样式

QTreeView

{

border:1px solid rgb(209,209,209);

}

QTreeView::branch:has-siblings:!adjoins-item {

border-image: url(Resources/vline.png) 0;

}

QTreeView::branch:has-siblings:adjoins-item {

border-image: url(Resources/branch-more.png) 0;

}

QTreeView::branch:!has-children:!has-siblings:adjoins-item {

border-image: url(Resources/branch-end.png) 0;

}

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

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

border-image: none;

image: url(Resources/branch-closed.png);

}

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

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

border-image: none;

image: url(Resources/branch-closed-hover.png);

}

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

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

border-image: none;

image: url(Resources/branch-open.png);

}

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

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

border-image: none;

image: url(Resources/branch-open-hover.png);

}

2 整个列表样式

/* 表头样式 */

QHeaderView::section

{

background:#F7F8F9;

color:#222222;

border-top:1px solid rgb(229,230,231);

border-bottom:0px solid rgb(229,230,231);

border-left:1px solid rgb(229,230,231);

padding-left:5px;

height:30px;

font-size:14px;

font-weight:medium;

}

/* 树 */

QTreeWidget{

border:0px;

background:transparent;

outline:0px;

color:#222222;

font:14px;

}

QTreeWidget::item

{

height:24px;

}

QTreeWidget::item:hover{

background:#DAEBF7;

}

QTreeWidget::item:selected{

background:#DAEBF7;

color:#222222;

}

QTreeWidget::branch:hover{

background:#DAEBF7;

}

QTreeWidget::branch:selected{

background:#DAEBF7;

color:#222222;

}

你可能感兴趣的:(QT,qss,前端,qt)