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.
More...
#include <qgscollapsiblegroupbox.h>
|
bool | saveCheckedState |
| Shall the checked state of this group box be saved and loaded persistently in QgsSettings. More...
|
|
bool | saveCollapsedState |
| Shall the collapsed state of this group box be saved and loaded persistently in QgsSettings. More...
|
|
bool | collapsed |
| The collapsed state of this group box. More...
|
|
bool | scrollOnExpand |
| If this property is set to true , a parent scroll area will try to make sure that the whole group box is visible when uncollapsing it. More...
|
|
QString | syncGroup |
| An optional group to be collapsed and uncollapsed in sync with this group box if the Alt-modifier is pressed while collapsing / uncollapsing. More...
|
|
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 class QgsCollapsibleGroupBoxBasic which does not auto-save states
- 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
Definition at line 185 of file qgscollapsiblegroupbox.h.
◆ QgsCollapsibleGroupBox() [1/2]
QgsCollapsibleGroupBox::QgsCollapsibleGroupBox |
( |
QWidget * |
parent = nullptr , |
|
|
QgsSettings * |
settings = nullptr |
|
) |
| |
◆ QgsCollapsibleGroupBox() [2/2]
QgsCollapsibleGroupBox::QgsCollapsibleGroupBox |
( |
const QString & |
title, |
|
|
QWidget * |
parent = nullptr , |
|
|
QgsSettings * |
settings = nullptr |
|
) |
| |
◆ ~QgsCollapsibleGroupBox()
QgsCollapsibleGroupBox::~QgsCollapsibleGroupBox |
( |
| ) |
|
|
override |
◆ init()
void QgsCollapsibleGroupBox::init |
( |
| ) |
|
|
protected |
◆ loadState
void QgsCollapsibleGroupBox::loadState |
( |
| ) |
|
|
protectedslot |
Will load the collapsed and checked state.
The configuration path from which it is loaded is defined by
- The object name
- The settingGroup
Definition at line 591 of file qgscollapsiblegroupbox.cpp.
◆ saveCheckedState()
bool QgsCollapsibleGroupBox::saveCheckedState |
( |
| ) |
|
|
inline |
◆ saveCollapsedState()
bool QgsCollapsibleGroupBox::saveCollapsedState |
( |
| ) |
|
|
inline |
◆ saveKey()
QString QgsCollapsibleGroupBox::saveKey |
( |
| ) |
const |
|
protected |
◆ saveState
void QgsCollapsibleGroupBox::saveState |
( |
| ) |
const |
|
protectedslot |
Will save the collapsed and checked state.
The configuration path to which it is saved is defined by
- The object name
- The settingGroup
Definition at line 621 of file qgscollapsiblegroupbox.cpp.
◆ setSaveCheckedState()
void QgsCollapsibleGroupBox::setSaveCheckedState |
( |
bool |
save | ) |
|
|
inline |
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
Definition at line 215 of file qgscollapsiblegroupbox.h.
◆ setSaveCollapsedState()
void QgsCollapsibleGroupBox::setSaveCollapsedState |
( |
bool |
save | ) |
|
|
inline |
◆ setSettingGroup()
void QgsCollapsibleGroupBox::setSettingGroup |
( |
const QString & |
group | ) |
|
|
inline |
Sets this to a defined string to share save/restore states across different parent dialogs.
Definition at line 220 of file qgscollapsiblegroupbox.h.
◆ setSettings()
void QgsCollapsibleGroupBox::setSettings |
( |
QgsSettings * |
settings | ) |
|
◆ settingGroup()
QString QgsCollapsibleGroupBox::settingGroup |
( |
| ) |
const |
|
inline |
Returns the name of the setting group in which the collapsed state will be saved.
Definition at line 222 of file qgscollapsiblegroupbox.h.
◆ showEvent()
void QgsCollapsibleGroupBox::showEvent |
( |
QShowEvent * |
event | ) |
|
|
overrideprotected |
◆ mDelSettings
bool QgsCollapsibleGroupBox::mDelSettings |
|
protected |
◆ mSaveCheckedState
bool QgsCollapsibleGroupBox::mSaveCheckedState |
|
protected |
◆ mSaveCollapsedState
bool QgsCollapsibleGroupBox::mSaveCollapsedState |
|
protected |
◆ mSettingGroup
QString QgsCollapsibleGroupBox::mSettingGroup |
|
protected |
◆ mSettings
QPointer<QgsSettings> QgsCollapsibleGroupBox::mSettings |
|
protected |
◆ saveCheckedState
bool QgsCollapsibleGroupBox::saveCheckedState |
|
readwrite |
◆ saveCollapsedState
bool QgsCollapsibleGroupBox::saveCollapsedState |
|
readwrite |
The documentation for this class was generated from the following files: