把下面代码放到对话框初始化函数中即可
# 设置树控件样式self.treeWidget.setStyleSheet("QTreeView::branch:open:has-children:!has-siblings,""QTreeView::branch:open:has-children:has-siblings {image: url(:/pic/images/minus.png);}""QTreeView::branch:closed:has-children:!has-siblings,""QTreeView::branch:closed:has-children:has-siblings {image: url(:/pic/images/plus.png);}")
效果图: