QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
A groupbox that collapses/expands when toggled and can save its collapsed and checked states. More...
#include <qgscollapsiblegroupbox.h>
Public Member Functions | |
QgsCollapsibleGroupBox (const QString &title, QWidget *parent=nullptr, QgsSettings *settings=nullptr) | |
QgsCollapsibleGroupBox (QWidget *parent=nullptr, QgsSettings *settings=nullptr) | |
~QgsCollapsibleGroupBox () override | |
bool | saveCheckedState () |
bool | saveCollapsedState () |
void | setSaveCheckedState (bool save) |
Set this to true to save/restore checked state. | |
void | setSaveCollapsedState (bool save) |
Sets this to false to not save/restore collapsed state. | |
void | setSettingGroup (const QString &group) |
Sets this to a defined string to share save/restore states across different parent dialogs. | |
void | setSettings (QgsSettings *settings) |
QString | settingGroup () const |
Returns the name of the setting group in which the collapsed state will be saved. | |
Public Member Functions inherited from QgsCollapsibleGroupBoxBasic | |
QgsCollapsibleGroupBoxBasic (const QString &title, QWidget *parent=nullptr) | |
QgsCollapsibleGroupBoxBasic (QWidget *parent=nullptr) | |
bool | isCollapsed () const |
Returns the current collapsed state of this group box. | |
bool | scrollOnExpand () |
If this is set to false the parent QScrollArea will not be automatically scrolled to this widget's contents when expanded. | |
void | setCollapsed (bool collapse) |
Collapse or uncollapse this groupbox. | |
void | setScrollOnExpand (bool scroll) |
Sets this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded. | |
void | setSyncGroup (const QString &grp) |
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. | |
QString | syncGroup () const |
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. | |
Protected Slots | |
void | loadState () |
Will load the collapsed and checked state. | |
void | saveState () const |
Will save the collapsed and checked state. | |
Protected Member Functions | |
QString | saveKey () const |
void | showEvent (QShowEvent *event) override |
Protected Member Functions inherited from QgsCollapsibleGroupBoxBasic | |
void | changeEvent (QEvent *event) override |
void | clearModifiers () |
void | collapseExpandFixes () |
Visual fixes for when group box is collapsed/expanded. | |
void | mousePressEvent (QMouseEvent *event) override |
void | mouseReleaseEvent (QMouseEvent *event) override |
void | showEvent (QShowEvent *event) override |
QRect | titleRect () const |
void | updateStyle () |
Properties | |
bool | saveCheckedState |
Shall the checked state of this group box be saved and loaded persistently in QgsSettings. | |
bool | saveCollapsedState |
Shall the collapsed state of this group box be saved and loaded persistently in QgsSettings. | |
Properties inherited from QgsCollapsibleGroupBoxBasic | |
bool | collapsed |
The collapsed state of this group box. | |
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. | |
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. | |
Additional Inherited Members | |
Public Slots inherited from QgsCollapsibleGroupBoxBasic | |
void | checkClicked (bool ckd) |
void | checkToggled (bool ckd) |
void | setStyleSheet (const QString &style) |
Overridden to prepare base call and avoid crash due to specific QT versions. | |
void | toggleCollapsed () |
Signals inherited from QgsCollapsibleGroupBoxBasic | |
void | collapsedStateChanged (bool collapsed) |
Signal emitted when groupbox collapsed/expanded state is changed, and when first shown. | |
Protected Attributes inherited from QgsCollapsibleGroupBoxBasic | |
bool | mAltDown |
QgsGroupBoxCollapseButton * | mCollapseButton = nullptr |
bool | mCollapsed |
QIcon | mCollapseIcon |
QIcon | mExpandIcon |
bool | mInitFlat |
bool | mInitFlatChecked |
QScrollArea * | mParentScrollArea = nullptr |
bool | mScrollOnExpand |
bool | mShiftDown |
bool | mShown |
QString | mSyncGroup |
QWidget * | mSyncParent = nullptr |
bool | mTitleClicked |
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
Definition at line 186 of file qgscollapsiblegroupbox.h.
QgsCollapsibleGroupBox::QgsCollapsibleGroupBox | ( | QWidget * | parent = nullptr , |
QgsSettings * | settings = nullptr |
||
) |
Definition at line 487 of file qgscollapsiblegroupbox.cpp.
QgsCollapsibleGroupBox::QgsCollapsibleGroupBox | ( | const QString & | title, |
QWidget * | parent = nullptr , |
||
QgsSettings * | settings = nullptr |
||
) |
Definition at line 494 of file qgscollapsiblegroupbox.cpp.
|
override |
Definition at line 501 of file qgscollapsiblegroupbox.cpp.
|
protectedslot |
Will load the collapsed and checked state.
The configuration path from which it is loaded is defined by
Definition at line 583 of file qgscollapsiblegroupbox.cpp.
|
inline |
Definition at line 218 of file qgscollapsiblegroupbox.h.
|
inline |
Definition at line 217 of file qgscollapsiblegroupbox.h.
|
protected |
Definition at line 561 of file qgscollapsiblegroupbox.cpp.
|
protectedslot |
Will save the collapsed and checked state.
The configuration path to which it is saved is defined by
Definition at line 613 of file qgscollapsiblegroupbox.cpp.
|
inline |
Set this to true
to save/restore checked state.
Definition at line 216 of file qgscollapsiblegroupbox.h.
|
inline |
Sets this to false
to not save/restore collapsed state.
Definition at line 209 of file qgscollapsiblegroupbox.h.
|
inline |
Sets this to a defined string to share save/restore states across different parent dialogs.
Definition at line 221 of file qgscollapsiblegroupbox.h.
void QgsCollapsibleGroupBox::setSettings | ( | QgsSettings * | settings | ) |
Definition at line 509 of file qgscollapsiblegroupbox.cpp.
|
inline |
Returns the name of the setting group in which the collapsed state will be saved.
Definition at line 223 of file qgscollapsiblegroupbox.h.
|
overrideprotected |
Definition at line 540 of file qgscollapsiblegroupbox.cpp.
|
readwrite |
Shall the checked state of this group box be saved and loaded persistently in QgsSettings.
Definition at line 198 of file qgscollapsiblegroupbox.h.
|
readwrite |
Shall the collapsed state of this group box be saved and loaded persistently in QgsSettings.
Definition at line 193 of file qgscollapsiblegroupbox.h.