QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
QgsCollapsibleGroupBoxBasic Class Reference

A groupbox that collapses/expands when toggled. More...

#include <qgscollapsiblegroupbox.h>

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

Public Slots

void checkToggled (bool ckd)
void checkClicked (bool ckd)
void toggleCollapsed ()

Signals

void collapsedStateChanged (bool collapsed)
 Signal emitted when groupbox collapsed/expanded state is changed, and when first shown.

Public Member Functions

 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.
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

Protected Member Functions

void init ()
void collapseExpandFixes ()
 Visual fixes for when group box is collapsed/expanded.
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

bool mCollapsed
bool mInitFlat
bool mInitFlatChecked
bool mScrollOnExpand
bool mShown
QScrollArea * mParentScrollArea
QgsGroupBoxCollapseButtonmCollapseButton
QWidget * mSyncParent
QString mSyncGroup
bool mAltDown
bool mShiftDown
bool mTitleClicked

Static Protected Attributes

static QIcon mCollapseIcon
static QIcon mExpandIcon

Properties

bool collapsed
QString syncGroup

Detailed Description

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

Definition at line 71 of file qgscollapsiblegroupbox.h.

Constructor & Destructor Documentation

QgsCollapsibleGroupBoxBasic::QgsCollapsibleGroupBoxBasic ( QWidget *  parent = 0)

Definition at line 33 of file qgscollapsiblegroupbox.cpp.

References init().

QgsCollapsibleGroupBoxBasic::QgsCollapsibleGroupBoxBasic ( const QString &  title,
QWidget *  parent = 0 
)

Definition at line 39 of file qgscollapsiblegroupbox.cpp.

References init().

QgsCollapsibleGroupBoxBasic::~QgsCollapsibleGroupBoxBasic ( )

Definition at line 46 of file qgscollapsiblegroupbox.cpp.

Member Function Documentation

void QgsCollapsibleGroupBoxBasic::changeEvent ( QEvent *  event)
protected

Definition at line 176 of file qgscollapsiblegroupbox.cpp.

References mCollapseButton.

void QgsCollapsibleGroupBoxBasic::checkClicked ( bool  ckd)
slot

Definition at line 221 of file qgscollapsiblegroupbox.cpp.

References isCollapsed(), and setCollapsed().

Referenced by init().

void QgsCollapsibleGroupBoxBasic::checkToggled ( bool  ckd)
slot

Definition at line 215 of file qgscollapsiblegroupbox.cpp.

References mCollapseButton.

Referenced by init().

void QgsCollapsibleGroupBoxBasic::clearModifiers ( )
protected
void QgsCollapsibleGroupBoxBasic::collapsedStateChanged ( bool  collapsed)
signal

Signal emitted when groupbox collapsed/expanded state is changed, and when first shown.

Referenced by setCollapsed(), and showEvent().

void QgsCollapsibleGroupBoxBasic::collapseExpandFixes ( )
protected

Visual fixes for when group box is collapsed/expanded.

Definition at line 445 of file qgscollapsiblegroupbox.cpp.

References mCollapsed.

Referenced by setCollapsed().

void QgsCollapsibleGroupBoxBasic::init ( )
protected
bool QgsCollapsibleGroupBoxBasic::isCollapsed ( ) const
inline
void QgsCollapsibleGroupBoxBasic::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 141 of file qgscollapsiblegroupbox.cpp.

References titleRect().

void QgsCollapsibleGroupBoxBasic::mouseReleaseEvent ( QMouseEvent *  event)
protected
void QgsCollapsibleGroupBoxBasic::setCollapsed ( bool  collapse)
void QgsCollapsibleGroupBoxBasic::setScrollOnExpand ( bool  scroll)
inline

set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded

Definition at line 91 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBoxBasic::setSyncGroup ( QString  grp)

Definition at line 188 of file qgscollapsiblegroupbox.cpp.

References mCollapseButton, mSyncGroup, and tr.

void QgsCollapsibleGroupBoxBasic::showEvent ( QShowEvent *  event)
protected
QString QgsCollapsibleGroupBoxBasic::syncGroup ( ) const
inline

Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key.

Definition at line 87 of file qgscollapsiblegroupbox.h.

Referenced by toggleCollapsed().

QRect QgsCollapsibleGroupBoxBasic::titleRect ( ) const
protected
void QgsCollapsibleGroupBoxBasic::toggleCollapsed ( )
slot
void QgsCollapsibleGroupBoxBasic::updateStyle ( )
protected

Definition at line 310 of file qgscollapsiblegroupbox.cpp.

References mCollapseButton, QgsDebugMsg, and titleRect().

Referenced by showEvent().

Member Data Documentation

bool QgsCollapsibleGroupBoxBasic::mAltDown
protected

Definition at line 126 of file qgscollapsiblegroupbox.h.

Referenced by clearModifiers(), init(), mouseReleaseEvent(), and toggleCollapsed().

QgsGroupBoxCollapseButton* QgsCollapsibleGroupBoxBasic::mCollapseButton
protected
bool QgsCollapsibleGroupBoxBasic::mCollapsed
protected
QIcon QgsCollapsibleGroupBoxBasic::mCollapseIcon
staticprotected

Definition at line 130 of file qgscollapsiblegroupbox.h.

Referenced by init(), and setCollapsed().

QIcon QgsCollapsibleGroupBoxBasic::mExpandIcon
staticprotected

Definition at line 131 of file qgscollapsiblegroupbox.h.

Referenced by init(), and setCollapsed().

bool QgsCollapsibleGroupBoxBasic::mInitFlat
protected
bool QgsCollapsibleGroupBoxBasic::mInitFlatChecked
protected

Definition at line 119 of file qgscollapsiblegroupbox.h.

Referenced by init(), showEvent(), and QgsCollapsibleGroupBox::showEvent().

QScrollArea* QgsCollapsibleGroupBoxBasic::mParentScrollArea
protected

Definition at line 122 of file qgscollapsiblegroupbox.h.

Referenced by init(), setCollapsed(), and showEvent().

bool QgsCollapsibleGroupBoxBasic::mScrollOnExpand
protected

Definition at line 120 of file qgscollapsiblegroupbox.h.

Referenced by init(), and setCollapsed().

bool QgsCollapsibleGroupBoxBasic::mShiftDown
protected

Definition at line 127 of file qgscollapsiblegroupbox.h.

Referenced by clearModifiers(), init(), mouseReleaseEvent(), and toggleCollapsed().

bool QgsCollapsibleGroupBoxBasic::mShown
protected
QString QgsCollapsibleGroupBoxBasic::mSyncGroup
protected

Definition at line 125 of file qgscollapsiblegroupbox.h.

Referenced by init(), setSyncGroup(), and toggleCollapsed().

QWidget* QgsCollapsibleGroupBoxBasic::mSyncParent
protected

Definition at line 124 of file qgscollapsiblegroupbox.h.

Referenced by init(), and toggleCollapsed().

bool QgsCollapsibleGroupBoxBasic::mTitleClicked
protected

Definition at line 128 of file qgscollapsiblegroupbox.h.

Referenced by init(), mouseReleaseEvent(), and toggleCollapsed().

Property Documentation

bool QgsCollapsibleGroupBoxBasic::collapsed
readwrite

Definition at line 75 of file qgscollapsiblegroupbox.h.

QString QgsCollapsibleGroupBoxBasic::syncGroup
readwrite

Definition at line 76 of file qgscollapsiblegroupbox.h.

Referenced by toggleCollapsed().


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