a QToolBox is like a QTabWidget, but the tabs are 'above each other'.
See the Qt widget gallery for an example.
This looks like a QTreeView to me.
Probably the header items are painted differently with a custom delegate.
a QToolBox is like a QTabWidget, but the tabs are 'above each other'.
See the Qt widget gallery for an example.
This looks like a QTreeView to me.
Probably the header items are painted differently with a custom delegate.
I already found a simple the solution.
If somebody else finds this widget box nice, here is how I do it:
1. I create a QDockWidget and put a QTreeWidget in it.
2. I set treeWidget.setRootIsDecorated(0)
3. Then I create a QTreeWidgetItem for each widget category and call
treeWidget.setItemWidget(item, 0, QPushButton("name", treeWidget))
4. I add widgets into each category by creating instances of QTreeWidgetItem.
Actually, instead of QPushButton I use MyPushButton, which is derived from QPushButton, in which I define mousePressEvent() using which I show or hide the widgets inside the category.
This is how the result looks like:
Quite similar to the Designer's gui, right.
Gregor
ricardo (2nd May 2009)
Bookmarks