Have multi-column QTreeWidget root items

I am using a QTreeWidget to display items in categories. Items will use several columns, but I want categories (ie. root items) to use the full width of the widget.

How can I do that?

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)
        # ...
        for category, bugs in reports:
            category_widget = QtGui.QTreeWidgetItem(self._tree, [category])
            # ...

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


Valentin Lorentz


Fixed with using QTreeWidgetItem::setFirstColumnSpanned.

Need Your Help

Lambda that does absolutely nothing

java lambda java-8 runnable

I needed to have a lambda expression of the functional interface Runnable that did nothing. I used to have a method

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.