Class: QgsCollapsibleGroupBox¶
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 its parent names.
Holding Alt modifier key when toggling collapsed state will synchronize the toggling across other collapsible group boxes with the same syncGroup string value
Holding Shift modifier key when attempting to toggle collapsed state will expand current group box, then collapse any others with the same syncGroup string value
See also
QgsCollapsibleGroupBoxBasic
which does not auto-save states
Note
To add Collapsible properties in promoted QtDesigner widgets, you can add the following “Dynamic properties” by clicking on the green + in the properties palette: bool collapsed, bool saveCollapsedState, bool saveCheckedState, string syncGroup
Class Hierarchy¶
Base classes¶
A groupbox that collapses/expands when toggled. |
|
Subclasses¶
Collapsible group box for configuration of extent, typically for a save operation. |
Methods
Will load the collapsed and checked state |
|
Will save the collapsed and checked state |
|
Set this to |
|
Sets this to |
|
Sets this to a defined string to share save/restore states across different parent dialogs |
|
Returns the name of the setting group in which the collapsed state will be saved |
- class qgis.gui.QgsCollapsibleGroupBox[source]¶
Bases:
QgsCollapsibleGroupBoxBasic
- loadState(self)[source]¶
Will load the collapsed and checked state
The configuration path from which it is loaded is defined by
The object name
The settingGroup
- saveState(self)[source]¶
Will save the collapsed and checked state
The configuration path to which it is saved is defined by
The object name
The settingGroup
- setSaveCheckedState(self, save: bool)[source]¶
Set this to
True
to save/restore checked stateNote
only turn on mSaveCheckedState for groupboxes NOT used in multiple places or used as options for different parent objects
- Parameters:
save (bool)
- setSaveCollapsedState(self, save: bool)[source]¶
Sets this to
False
to not save/restore collapsed state- Parameters:
save (bool)
- setSettingGroup(self, group: str | None)[source]¶
Sets this to a defined string to share save/restore states across different parent dialogs
- Parameters:
group (Optional[str])
- setSettings(self, settings: QgsSettings | None)[source]¶
- Parameters:
settings (Optional[QgsSettings])