A groupbox that collapses/expands when toggled. Basic class QgsCollapsibleGroupBoxBasic does not auto-save collapsed or checked state 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>
|
| QgsCollapsibleGroupBoxBasic (const QString &title, QWidget *parent=nullptr) |
|
| QgsCollapsibleGroupBoxBasic (QWidget *parent=nullptr) |
|
bool | isCollapsed () const |
| Returns the current collapsed state of this group box. More...
|
|
bool | scrollOnExpand () |
| If this is set to false the parent QScrollArea will not be automatically scrolled to this widget's contents when expanded. More...
|
|
void | setCollapsed (bool collapse) |
| Collapse or uncollapse this groupbox. More...
|
|
void | setScrollOnExpand (bool scroll) |
| Sets this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded. More...
|
|
void | setSyncGroup (const QString &grp) |
| Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. More...
|
|
QString | syncGroup () const |
| Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. 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. Basic class QgsCollapsibleGroupBoxBasic does not auto-save collapsed or checked state 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.
- 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, QString syncGroup, bool scrollOnExpand
Definition at line 71 of file qgscollapsiblegroupbox.h.
◆ QgsCollapsibleGroupBoxBasic() [1/2]
QgsCollapsibleGroupBoxBasic::QgsCollapsibleGroupBoxBasic |
( |
QWidget * |
parent = nullptr | ) |
|
◆ QgsCollapsibleGroupBoxBasic() [2/2]
QgsCollapsibleGroupBoxBasic::QgsCollapsibleGroupBoxBasic |
( |
const QString & |
title, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
◆ changeEvent()
void QgsCollapsibleGroupBoxBasic::changeEvent |
( |
QEvent * |
event | ) |
|
|
overrideprotected |
◆ checkClicked
void QgsCollapsibleGroupBoxBasic::checkClicked |
( |
bool |
ckd | ) |
|
|
slot |
◆ checkToggled
void QgsCollapsibleGroupBoxBasic::checkToggled |
( |
bool |
ckd | ) |
|
|
slot |
◆ clearModifiers()
void QgsCollapsibleGroupBoxBasic::clearModifiers |
( |
| ) |
|
|
protected |
◆ collapsedStateChanged
void QgsCollapsibleGroupBoxBasic::collapsedStateChanged |
( |
bool |
collapsed | ) |
|
|
signal |
Signal emitted when groupbox collapsed/expanded state is changed, and when first shown.
◆ collapseExpandFixes()
void QgsCollapsibleGroupBoxBasic::collapseExpandFixes |
( |
| ) |
|
|
protected |
◆ init()
void QgsCollapsibleGroupBoxBasic::init |
( |
| ) |
|
|
protected |
◆ isCollapsed()
bool QgsCollapsibleGroupBoxBasic::isCollapsed |
( |
| ) |
const |
|
inline |
◆ mousePressEvent()
void QgsCollapsibleGroupBoxBasic::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ mouseReleaseEvent()
void QgsCollapsibleGroupBoxBasic::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ scrollOnExpand()
bool QgsCollapsibleGroupBoxBasic::scrollOnExpand |
( |
| ) |
|
|
inline |
If this is set to false
the parent QScrollArea will not be automatically scrolled to this widget's contents when expanded.
Definition at line 123 of file qgscollapsiblegroupbox.h.
◆ setCollapsed()
void QgsCollapsibleGroupBoxBasic::setCollapsed |
( |
bool |
collapse | ) |
|
Collapse or uncollapse this groupbox.
- Parameters
-
collapse | Will collapse on true and uncollapse on false |
Definition at line 405 of file qgscollapsiblegroupbox.cpp.
◆ setScrollOnExpand()
void QgsCollapsibleGroupBoxBasic::setScrollOnExpand |
( |
bool |
scroll | ) |
|
|
inline |
Sets this to false
to not automatically scroll parent QScrollArea to this widget's contents when expanded.
Definition at line 120 of file qgscollapsiblegroupbox.h.
◆ setStyleSheet
void QgsCollapsibleGroupBoxBasic::setStyleSheet |
( |
const QString & |
style | ) |
|
|
slot |
Overridden to prepare base call and avoid crash due to specific QT versions.
- Since
- QGIS 3.16
Definition at line 300 of file qgscollapsiblegroupbox.cpp.
◆ setSyncGroup()
void QgsCollapsibleGroupBoxBasic::setSyncGroup |
( |
const QString & |
grp | ) |
|
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key.
Definition at line 178 of file qgscollapsiblegroupbox.cpp.
◆ showEvent()
void QgsCollapsibleGroupBoxBasic::showEvent |
( |
QShowEvent * |
event | ) |
|
|
overrideprotected |
◆ syncGroup()
QString QgsCollapsibleGroupBoxBasic::syncGroup |
( |
| ) |
const |
|
inline |
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key.
Definition at line 112 of file qgscollapsiblegroupbox.h.
◆ titleRect()
QRect QgsCollapsibleGroupBoxBasic::titleRect |
( |
| ) |
const |
|
protected |
◆ toggleCollapsed
void QgsCollapsibleGroupBoxBasic::toggleCollapsed |
( |
| ) |
|
|
slot |
◆ updateStyle()
void QgsCollapsibleGroupBoxBasic::updateStyle |
( |
| ) |
|
|
protected |
◆ mAltDown
bool QgsCollapsibleGroupBoxBasic::mAltDown |
|
protected |
◆ mCollapseButton
◆ mCollapsed
bool QgsCollapsibleGroupBoxBasic::mCollapsed |
|
protected |
◆ mCollapseIcon
QIcon QgsCollapsibleGroupBoxBasic::mCollapseIcon |
|
protected |
◆ mExpandIcon
QIcon QgsCollapsibleGroupBoxBasic::mExpandIcon |
|
protected |
◆ mInitFlat
bool QgsCollapsibleGroupBoxBasic::mInitFlat |
|
protected |
◆ mInitFlatChecked
bool QgsCollapsibleGroupBoxBasic::mInitFlatChecked |
|
protected |
◆ mParentScrollArea
QScrollArea* QgsCollapsibleGroupBoxBasic::mParentScrollArea = nullptr |
|
protected |
◆ mScrollOnExpand
bool QgsCollapsibleGroupBoxBasic::mScrollOnExpand |
|
protected |
◆ mShiftDown
bool QgsCollapsibleGroupBoxBasic::mShiftDown |
|
protected |
◆ mShown
bool QgsCollapsibleGroupBoxBasic::mShown |
|
protected |
◆ mSyncGroup
QString QgsCollapsibleGroupBoxBasic::mSyncGroup |
|
protected |
◆ mSyncParent
QWidget* QgsCollapsibleGroupBoxBasic::mSyncParent = nullptr |
|
protected |
◆ mTitleClicked
bool QgsCollapsibleGroupBoxBasic::mTitleClicked |
|
protected |
◆ collapsed
bool QgsCollapsibleGroupBoxBasic::collapsed |
|
readwrite |
The collapsed state of this group box.
If it is set to true
, all content is hidden if it is set to false
all content is shown.
Definition at line 79 of file qgscollapsiblegroupbox.h.
◆ scrollOnExpand
bool QgsCollapsibleGroupBoxBasic::scrollOnExpand |
|
readwrite |
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.
Definition at line 91 of file qgscollapsiblegroupbox.h.
◆ syncGroup
QString QgsCollapsibleGroupBoxBasic::syncGroup |
|
readwrite |
An optional group to be collapsed and uncollapsed in sync with this group box if the Alt-modifier is pressed while collapsing / uncollapsing.
Definition at line 85 of file qgscollapsiblegroupbox.h.
The documentation for this class was generated from the following files: