Class: QgsCollapsibleGroupBox

class qgis.gui.QgsCollapsibleGroupBox

Bases: QgsCollapsibleGroupBoxBasic

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

See also

basic()

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, QString syncGroup

Methods

actionEvent

changeEvent

childEvent

clearModifiers

closeEvent

collapseExpandFixes

Visual fixes for when group box is collapsed/expanded

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

init

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

loadState

Will load the collapsed and checked state

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

saveCheckedState

rtype:

bool

saveCollapsedState

rtype:

bool

saveKey

rtype:

str

saveState

Will save the collapsed and checked state

sender

senderSignalIndex

setSaveCheckedState

Set this to True to save/restore checked state

setSaveCollapsedState

Sets this to False to not save/restore collapsed state

setSettingGroup

Sets this to a defined string to share save/restore states across different parent dialogs

setSettings

param settings:

settingGroup

Returns the name of the setting group in which the collapsed state will be saved

sharedPainter

showEvent

param event:

tabletEvent

timerEvent

titleRect

updateMicroFocus

updateStyle

wheelEvent

actionEvent(self, QActionEvent)
changeEvent(self, event: QEvent)
childEvent(self, QChildEvent)
clearModifiers(self)
closeEvent(self, QCloseEvent)
collapseExpandFixes(self)

Visual fixes for when group box is collapsed/expanded

connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
init(self)
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionGroupBox)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
loadState(self)

Will load the collapsed and checked state

The configuration path from which it is loaded is defined by

  • The object name

  • The settingGroup

metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, event: QMouseEvent)
mouseReleaseEvent(self, event: QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
saveCheckedState(self) bool
Return type:

bool

saveCollapsedState(self) bool
Return type:

bool

saveKey(self) str
Return type:

str

saveState(self)

Will save the collapsed and checked state

The configuration path to which it is saved is defined by

  • The object name

  • The settingGroup

sender(self) QObject
senderSignalIndex(self) int
setSaveCheckedState(self, save: bool)

Set this to True to save/restore checked state

Note

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)

Sets this to False to not save/restore collapsed state

Parameters:

save (bool) –

setSettingGroup(self, group: str)

Sets this to a defined string to share save/restore states across different parent dialogs

Parameters:

group (str) –

setSettings(self, settings: QgsSettings)
Parameters:

settings (QgsSettings) –

settingGroup(self) str

Returns the name of the setting group in which the collapsed state will be saved

Return type:

str

sharedPainter(self) QPainter
showEvent(self, event: QShowEvent)
Parameters:

event (QShowEvent) –

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
titleRect(self) QRect
updateMicroFocus(self)
updateStyle(self)
wheelEvent(self, QWheelEvent)