QTreeView 样式设置以及Checkbox复选框样式设置
这种样式设置如下
QTreeView { background: #303033; font-size:16px; color: rgba(255,255,255,1); border:0px; } QTreeView::item { background: #303033; height:40px; } QTreeView::branch { background:#303033; } QTreeView::item:hover { background: rgba(255,255,255,0.12); } QTreeView::item:selected{ background: rgba(32,128,247,0.32); } QTreeView::branch:closed:has-children:!has-siblings, QTreeView::branch:closed:has-children:has-siblings { background-image:url(:/analysisCenter/Resources/analysisCenter/arrowexpend-nor.svg); background-repeat:no-repeat; background-position:center; } QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-children:has-siblings { background-image:url(:/analysisCenter/Resources/analysisCenter/arrowclose-nor.svg); background-repeat:no-repeat; background-position:center; } QTreeView::indicator { width:16px; height:16px; } QTreeView::indicator:unchecked { border-image:url(:/analysisCenter/Resources/analysisCenter/checkbox-normal.svg); background-repeat:no-repeat; background-position:center; } QTreeView::indicator:hover { border-image:url(:/analysisCenter/Resources/analysisCenter/checkbox-hover.svg); background-repeat:no-repeat; background-position:center; } QTreeView::indicator:checked { border-image:url(:/analysisCenter/Resources/analysisCenter/checkbox-sel.svg); background-repeat:no-repeat; background-position:center; }
其他属性设置参考
https://blog.csdn.net/lmhuanying1012/article/details/79682186
自己开发了一个股票智能分析软件,功能很强大,需要的关注微信公众号:QStockView