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)}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM