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 propreties palette: bool collapsed, bool saveCollapsedState, bool saveCheckedState, QString syncGroup

Methods

actionEvent

changeEvent

childEvent

clearModifiers

closeEvent

collapseExpandFixes

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()
changeEvent()
childEvent()
clearModifiers()
closeEvent()
collapseExpandFixes()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
init(self)
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
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()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
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()
senderSignalIndex()
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()
showEvent(self, event: QShowEvent)
Parameters

event (QShowEvent) –

tabletEvent()
timerEvent()
titleRect()
updateMicroFocus()
updateStyle()
wheelEvent()