隐藏左侧的小箭头

QTreeView

rootIsDecorated : bool

treeView.setRootIsDecorated(False)

 

或者

 

    treeView.setStyleSheet( "QTreeView::branch {image:none;}" )

 

 

 

 设置item不同状态下显示背景色的代码,设置方法同上: 源码中设置:
 treeWidget->setStyleSheet( "QTreeView::item:hover{background-color:rgb(0,255,0,50)}"
 "QTreeView::item:selected{background-color:rgb(255,0,0,100)}" );
 在样式设置界面,添加如下两句:
 QTreeView::item:hover{background-color:rgb(0,255,0,50)}
 QTreeView::item:selected{background-color:rgb(255,0,0,100)}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-23
  • 2021-08-09
  • 2021-10-11
  • 2021-09-25
相关资源
相似解决方案