You have QTreeWidget multi-column root elements

I use QTreeWidget to display items in categories. Elements will use multiple columns, but I want the categories (i.e. Root Elements) to use the full width of the widget.

How can i do this?

And a piece of my code:

class BugsList(QtGui.QDialog): def __init__(self, parent, reports): super(BugsList, self).__init__(parent) # Call QDialog constructor self._tree = QtGui.QTreeWidget(self) self._tree.setColumnCount(NUMBER_OF_COLUMNS) # ... for category, bugs in reports: category_widget = QtGui.QTreeWidgetItem(self._tree, [category]) # ... 

Here is a screenshot of the current status of my application: screenshot

+7
source share
1 answer

Fixed using QTreeWidgetItem :: setFirstColumnSpanned.

+6
source

All Articles