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 中间加个:可以当作判断条件&&来使用