(self.ui.qtreeview.header()).setResizeMode(3)
(self.ui.qtreeview.header()).setResizeMode(3)
To copy to clipboard, switch view to plain text mode
That works great ! But now I have another 2 problems. The first one is that I can't hide one of the columns, I tried with this:
index = (self.ui.qtreeview.header()).visualIndex(4)
(self.ui.qtreeview.header()).setSectionHidden(index, True)
index = (self.ui.qtreeview.header()).visualIndex(4)
(self.ui.qtreeview.header()).setSectionHidden(index, True)
To copy to clipboard, switch view to plain text mode
The second problem is that I have some qstandarditems that have really long text, and when the text-column is expanded according to the size of the text, the QTreeView will become... scrollable (horizontally). How can I prevent that?
Bookmarks