Class: QgsCollapsibleGroupBoxBasic¶
A groupbox that collapses/expands when toggled.
The basic class QgsCollapsibleGroupBoxBasic
does not
auto-save collapsed or checked states.
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.
Note
To add Collapsible properties in promoted QtDesigner widgets, you can add the following “Dynamic properties” by clicking on the green + in the propreties palette: bool collapsed, string syncGroup, bool scrollOnExpand
Class Hierarchy¶
Base classes¶
Subclasses¶
A groupbox that collapses/expands when toggled and can save its collapsed and checked states. |
Methods
Visual fixes for when group box is collapsed/expanded |
|
Returns the current collapsed state of this group box |
|
If this is set to |
|
Collapse or uncollapse this groupbox |
|
Sets this to |
|
Overridden to prepare base call and avoid crash due to specific QT versions |
|
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key |
|
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key |
|
Signals
Signal emitted when groupbox collapsed/expanded state is changed, and when first shown |
- class qgis.gui.QgsCollapsibleGroupBoxBasic[source]¶
Bases:
QGroupBox
- signal collapsedStateChanged(collapsed: bool)[source]¶
Signal emitted when groupbox collapsed/expanded state is changed, and when first shown
- Parameters:
collapsed (bool)
- isCollapsed(self) bool [source]¶
Returns the current collapsed state of this group box
- Return type:
bool
- scrollOnExpand(self) bool [source]¶
If this is set to
False
the parent QScrollArea will not be automatically scrolled to this widget’s contents when expanded- Return type:
bool
- setCollapsed(self, collapse: bool)[source]¶
Collapse or uncollapse this groupbox
- Parameters:
collapse (bool) – Will collapse on
True
and uncollapse onFalse
- setScrollOnExpand(self, scroll: bool)[source]¶
Sets this to
False
to not automatically scroll parent QScrollArea to this widget’s contents when expanded- Parameters:
scroll (bool)
- setStyleSheet(self, style: str | None)[source]¶
Overridden to prepare base call and avoid crash due to specific QT versions
Added in version 3.16.
- Parameters:
style (Optional[str])
- setSyncGroup(self, grp: str | None)[source]¶
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key
- Parameters:
grp (Optional[str])