In short, take a look at QTreeView (and QTreeWidget).![]()
In short, take a look at QTreeView (and QTreeWidget).![]()
J-P Nurmi
Try overriding QTreeView::drawBranches() with an empty implementation.
See QTreeView::itemsExpandable property.Furthermore, I don't want to have the possibility that people fold a complete group, it must be always shown unfolded.
J-P Nurmi
gdiepen (16th January 2008)
It will work![]()
The setExpandable for sure did the trick for one part. For this I am really happy
The other answer, your suggestion to override the drawBranches method is what I am currently working on. I don't think that I can just add a QTreeView widget to my window (with qt4-designer) and just override the drawBranches in my Python code. My guess is that I will have to create my own widget for this, in which I override the drawBranches method.
If somebody knows of a really easy way of overriding this function in Python with PyQt4, I would be really grateful for that.
Yes, I got it to work
Just to make sure, if somebody reads this thread he gets all information:
self.myTreeView is a QTreeView Object.
First I define a new function that will take care of the drawBranches, called myDrawBranches
After this, I only have to do: self.treeView.drawBranches = myDrawBranches
And everything is working
Thank you guys!!!
Bookmarks