QgsCollapsibleGroupBox class

A groupbox that collapses/expands when toggled and can save its collapsed and checked states.

By default, it auto-saves only its collapsed state to the global settings based on the widget and it's parent names. Holding Alt modifier key when toggling collapsed state will synchronize the toggling across other collapsible group boxes with the same syncGroup QString value Holding Shift modifier key when attempting to toggle collapsed state will expand current group box, then collapse any others with the same syncGroup QString value

Base classes

class QgsCollapsibleGroupBoxBasic
A groupbox that collapses/expands when toggled.

Derived classes

class QgsExtentGroupBox
Collapsible group box for configuration of extent, typically for a save operation.

Public functions

void setSaveCheckedState(bool save)
Set this to true to save/restore checked state.
void setSaveCollapsedState(bool save)
Sets this to false to not save/restore collapsed state.
void setSettingGroup(const QString& group)
Sets this to a defined string to share save/restore states across different parent dialogs.
auto settingGroup() const -> QString
Returns the name of the setting group in which the collapsed state will be saved.

Protected slots

void loadState()
Will load the collapsed and checked state.
void saveState() const
Will save the collapsed and checked state.

Function documentation

void QgsCollapsibleGroupBox::setSaveCheckedState(bool save)

Set this to true to save/restore checked state.

void QgsCollapsibleGroupBox::loadState() protected slot

Will load the collapsed and checked state.

The configuration path from which it is loaded is defined by

  • The object name
  • The settingGroup

void QgsCollapsibleGroupBox::saveState() const protected slot

Will save the collapsed and checked state.

The configuration path to which it is saved is defined by

  • The object name
  • The settingGroup