18 #ifndef QGSCOLLAPSIBLEGROUPBOX_H 19 #define QGSCOLLAPSIBLEGROUPBOX_H 26 #include <QToolButton> 27 #include <QMouseEvent> 57 mAltDown = (
event->modifiers() & ( Qt::AltModifier | Qt::ControlModifier ) );
58 mShiftDown = (
event->modifiers() & Qt::ShiftModifier );
85 Q_PROPERTY(
bool collapsed READ isCollapsed WRITE setCollapsed USER
true )
91 Q_PROPERTY(
QString syncGroup READ syncGroup WRITE setSyncGroup )
97 Q_PROPERTY(
bool scrollOnExpand READ scrollOnExpand WRITE setScrollOnExpand )
107 bool isCollapsed()
const {
return mCollapsed; }
113 void setCollapsed(
bool collapse );
123 void setSyncGroup(
const QString& grp );
133 void collapsedStateChanged(
bool collapsed );
136 void checkToggled(
bool ckd );
137 void checkClicked(
bool ckd );
138 void toggleCollapsed();
144 void collapseExpandFixes();
152 QRect titleRect()
const;
153 void clearModifiers();
190 Q_PROPERTY(
bool saveCollapsedState READ saveCollapsedState WRITE setSaveCollapsedState )
195 Q_PROPERTY(
bool saveCheckedState READ saveCheckedState WRITE setSaveCheckedState )
206 void setSaveCollapsedState(
bool save ) { mSaveCollapsedState = save; }
235 void saveState()
const;
A groupbox that collapses/expands when toggled and can save its collapsed and checked states...
void setSaveCheckedState(bool save)
Set this to true to save/restore checked state.
QScrollArea * mParentScrollArea
void setScrollOnExpand(bool scroll)
Set this to false to not automatically scroll parent QScrollArea to this widget's contents when expan...
void showEvent(QShowEvent *event) override
QgsGroupBoxCollapseButton * mCollapseButton
QString syncGroup() const
Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier ...
A groupbox that collapses/expands when toggled.
virtual void mouseReleaseEvent(QMouseEvent *event)
bool scrollOnExpand()
If this is set to false the parent QScrollArea will not be automatically scrolled to this widget's co...
void setSettingGroup(const QString &group)
Set this to a defined string to share save/restore states across different parent dialogs...
virtual void changeEvent(QEvent *ev)
bool saveCollapsedState()
virtual void mousePressEvent(QMouseEvent *event)
QPointer< QSettings > mSettings
QString settingGroup() const
Returns the name of the setting group in which the collapsed state will be saved. ...