CollapsibleSection

A section with a header bar that shows or hides one content widget.

Declared in src/libs/libwidgets/widgets/CollapsibleSection.hpp
Inherits QWidget
Group widgets

Detailed description

The header is a button with the title and an arrow. A click on the header toggles the section: the arrow points down when the section is expanded and right when it is collapsed. A new section is expanded. Put several sections in a QVBoxLayout to make a column of cards.

The section takes ownership of the widget given to setContentWidget() and of the widget given to setHeaderTrailingWidget(). A new widget replaces the previous one, and the section deletes the previous one.

Property documentation

expanded property

expanded : bool

This property holds whether the content of the section is visible.

A change updates the header arrow, shows or hides the content and emits expandedChanged(). A click on the header and toggle() change this property. The default is true.

Access functions:

  • bool isExpanded() const
  • void setExpanded(bool expanded)

Notifier signal:

  • void expandedChanged(bool expanded)

title property

title : QString

This property holds the text on the header button.

The default is the title given to the constructor.

Access functions:

  • QString title() const
  • void setTitle(const QString &title)
In this section