Hint: create a custom widget, especially if you want your collapsible group boxes to look like that.
It shouldn't be very complex:
You will have:
1. The group box widget with a vertical layout( QWidget )
2. Two widgets contained by the widget at 1). 2.1. The group box title bar(QWidget with a horizontal layout, containing a horizontal spacer and a custom button. the spacer is needed to push the collapse/expand button to the right )
2.2. The group box client area -- just a QWidget in which you can add other widgets
3. The widget from 2.1 should contain the expand/collapse button. When this button is pressed then the widget at 2.2 should be hidden/shown.
Hiding the widget will cause the vertical layout set to widget 1) to update its size, shrinking to the size of the title bar.
Showing the widget will have an opposed effect.
Regards
Bookmarks