Collapsible Widget
We have a Collapsible Widget called a “Section” available. This kind of widget can expand to display the contents of the widget. This is useful for making an interface appear less cluttered.
General process for to add collapsible Widget:
QT Designer:
Ensure the parent widget is in a vertical layout
Create QWidget inside and promote it to a “Section”
Create another QWidget within that QWidget. The inner QWidget will hold all the contents of the section.
Populate this inner QWidget with widgets as normal.
Code part:
Call
autoSetContentLayout()
on the Section QWidget aftersetupUi
.Optionally, calling
setTitle("title")
will give it a title.