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. |
- class qgis.gui.QgsCollapsibleGroupBoxBasic[source]¶
Bases:
QGroupBox- signal collapsedStateChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- 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
Falsethe 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
Trueand uncollapse onFalse
- setScrollOnExpand(self, scroll: bool)[source]¶
Sets this to
Falseto 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])