/* QTreeView */ QTreeView { alternate-background-color: yellow; } QTreeView { show-decoration-selected: 1; } QTreeView::item { border: 1px solid #d9d9d9; border-top-color: transparent; border-bottom-color: transparent; } /* 鼠标在QTreeView上面移动时的效果 */ QTreeView::item:hover { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1); border: 1px solid #bfcde4; } QTreeView::item:selected { border: 1px solid #567dbc; } /* 节点被选中激活时的效果 */ QTreeView::item:selected:active{ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc); } QTreeView::item:selected:!active { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6b9be8, stop: 1 #577fbf); } QTreeView::branch:has-siblings:!adjoins-item { border-image: url(:/images/vline.png)0; } QTreeView::branch:has-siblings:adjoins-item { border-image: url(:/images/branch-more.png)0; } QTreeView::branch:!has-children:!has-siblings:adjoins-item { border-image: url(:/images/branch-end.png)0; } QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings { border-image: none; image: url(:/images/branch-closed.png); } QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-children:has-siblings { border-image: none; image: url(:/images/branch-open.png); }
注意:注释的时候一定要使用/* */
本文出自 “大白菜” 博客,请务必保留此出处http://zhengyongkun.blog.51cto.com/1163218/1533816
原文地址:http://zhengyongkun.blog.51cto.com/1163218/1533816