QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
QgsCollapsibleGroupBox Class Reference

A groupbox that collapses/expands when toggled and can save its collapsed and checked states. More...

#include <qgscollapsiblegroupbox.h>

Inheritance diagram for QgsCollapsibleGroupBox:
Inheritance graph
[legend]
Collaboration diagram for QgsCollapsibleGroupBox:
Collaboration graph
[legend]

Public Member Functions

 QgsCollapsibleGroupBox (QWidget *parent=0, QSettings *settings=0)
 
 QgsCollapsibleGroupBox (const QString &title, QWidget *parent=0, QSettings *settings=0)
 
 ~QgsCollapsibleGroupBox ()
 
void setSettings (QSettings *settings)
 
void setSaveCollapsedState (bool save)
 set this to false to not save/restore collapsed state More...
 
void setSaveCheckedState (bool save)
 set this to true to save/restore checked state More...
 
bool saveCollapsedState ()
 
bool saveCheckedState ()
 
void setSettingGroup (const QString &group)
 set this to a defined string to share save/restore states across different parent dialogs More...
 
QString settingGroup () const
 
- Public Member Functions inherited from QgsCollapsibleGroupBoxBasic
 QgsCollapsibleGroupBoxBasic (QWidget *parent=0)
 
 QgsCollapsibleGroupBoxBasic (const QString &title, QWidget *parent=0)
 
 ~QgsCollapsibleGroupBoxBasic ()
 
bool isCollapsed () const
 
void setCollapsed (bool collapse)
 
QString syncGroup () const
 Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. More...
 
void setSyncGroup (QString grp)
 
void setScrollOnExpand (bool scroll)
 set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded More...
 

Protected Slots

void loadState ()
 
void saveState ()
 

Protected Member Functions

void init ()
 
void showEvent (QShowEvent *event)
 
QString saveKey () const
 
- Protected Member Functions inherited from QgsCollapsibleGroupBoxBasic
void init ()
 
void collapseExpandFixes ()
 Visual fixes for when group box is collapsed/expanded. More...
 
void showEvent (QShowEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void changeEvent (QEvent *event)
 
void updateStyle ()
 
QRect titleRect () const
 
void clearModifiers ()
 

Protected Attributes

QPointer< QSettings > mSettings
 
bool mDelSettings
 
bool mSaveCollapsedState
 
bool mSaveCheckedState
 
QString mSettingGroup
 
- Protected Attributes inherited from QgsCollapsibleGroupBoxBasic
bool mCollapsed
 
bool mInitFlat
 
bool mInitFlatChecked
 
bool mScrollOnExpand
 
bool mShown
 
QScrollArea * mParentScrollArea
 
QgsGroupBoxCollapseButtonmCollapseButton
 
QWidget * mSyncParent
 
QString mSyncGroup
 
bool mAltDown
 
bool mShiftDown
 
bool mTitleClicked
 

Properties

bool collapsed
 
bool saveCollapsedState
 
bool saveCheckedState
 
QString syncGroup
 
- Properties inherited from QgsCollapsibleGroupBoxBasic
bool collapsed
 
QString syncGroup
 

Additional Inherited Members

- Public Slots inherited from QgsCollapsibleGroupBoxBasic
void checkToggled (bool ckd)
 
void checkClicked (bool ckd)
 
void toggleCollapsed ()
 
- Signals inherited from QgsCollapsibleGroupBoxBasic
void collapsedStateChanged (bool collapsed)
 Signal emitted when groupbox collapsed/expanded state is changed, and when first shown. More...
 
- Static Protected Attributes inherited from QgsCollapsibleGroupBoxBasic
static QIcon mCollapseIcon
 
static QIcon mExpandIcon
 

Detailed Description

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

Definition at line 145 of file qgscollapsiblegroupbox.h.

Constructor & Destructor Documentation

QgsCollapsibleGroupBox::QgsCollapsibleGroupBox ( QWidget *  parent = 0,
QSettings *  settings = 0 
)

Definition at line 507 of file qgscollapsiblegroupbox.cpp.

References init().

QgsCollapsibleGroupBox::QgsCollapsibleGroupBox ( const QString &  title,
QWidget *  parent = 0,
QSettings *  settings = 0 
)

Definition at line 513 of file qgscollapsiblegroupbox.cpp.

References init().

QgsCollapsibleGroupBox::~QgsCollapsibleGroupBox ( )

Definition at line 520 of file qgscollapsiblegroupbox.cpp.

References mDelSettings, mSettings, and saveState().

Member Function Documentation

void QgsCollapsibleGroupBox::init ( )
protected
void QgsCollapsibleGroupBox::loadState ( )
protectedslot
bool QgsCollapsibleGroupBox::saveCheckedState ( )
inline

Definition at line 169 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBox::saveCollapsedState ( )
inline

Definition at line 168 of file qgscollapsiblegroupbox.h.

QString QgsCollapsibleGroupBox::saveKey ( ) const
protected

Definition at line 579 of file qgscollapsiblegroupbox.cpp.

References mSettingGroup.

Referenced by loadState(), and saveState().

void QgsCollapsibleGroupBox::saveState ( )
protectedslot
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 167 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBox::setSaveCollapsedState ( bool  save)
inline

set this to false to not save/restore collapsed state

Definition at line 163 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBox::setSettingGroup ( const QString &  group)
inline

set this to a defined string to share save/restore states across different parent dialogs

Definition at line 172 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBox::setSettings ( QSettings *  settings)

Definition at line 529 of file qgscollapsiblegroupbox.cpp.

References mDelSettings, and mSettings.

QString QgsCollapsibleGroupBox::settingGroup ( ) const
inline

Definition at line 173 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBox::showEvent ( QShowEvent *  event)
protected

Member Data Documentation

bool QgsCollapsibleGroupBox::mDelSettings
protected

Definition at line 187 of file qgscollapsiblegroupbox.h.

Referenced by init(), setSettings(), and ~QgsCollapsibleGroupBox().

bool QgsCollapsibleGroupBox::mSaveCheckedState
protected

Definition at line 190 of file qgscollapsiblegroupbox.h.

Referenced by init(), loadState(), and saveState().

bool QgsCollapsibleGroupBox::mSaveCollapsedState
protected

Definition at line 189 of file qgscollapsiblegroupbox.h.

Referenced by init(), loadState(), and saveState().

QString QgsCollapsibleGroupBox::mSettingGroup
protected

Definition at line 191 of file qgscollapsiblegroupbox.h.

Referenced by init(), and saveKey().

QPointer<QSettings> QgsCollapsibleGroupBox::mSettings
protected

Property Documentation

bool QgsCollapsibleGroupBox::collapsed
readwrite

Definition at line 149 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBox::saveCheckedState
readwrite

Definition at line 151 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBox::saveCollapsedState
readwrite

Definition at line 150 of file qgscollapsiblegroupbox.h.

QString QgsCollapsibleGroupBox::syncGroup
readwrite

Definition at line 152 of file qgscollapsiblegroupbox.h.


The documentation for this class was generated from the following files: