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

Inheritance diagram of qgis.gui.QgsCollapsibleGroupBoxBasic

Base classes

QGroupBox

QWidget

QObject

QPaintDevice

Subclasses

QgsCollapsibleGroupBox

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

class qgis.gui.QgsCollapsibleGroupBoxBasic[source]

Bases: QGroupBox

checkClicked(self, ckd: bool)[source]
Parameters:

ckd (bool)

checkToggled(self, ckd: bool)[source]
Parameters:

ckd (bool)

clearModifiers(self)[source]
collapseExpandFixes(self)[source]

Visual fixes for when group box is collapsed/expanded

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 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 on False

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])

syncGroup(self) str[source]

Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key

Return type:

str

titleRect(self) QRect[source]
Return type:

QRect

toggleCollapsed(self)[source]
updateStyle(self)[source]