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

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

#include <qgscollapsiblegroupbox.h>

Inheritance diagram for QgsCollapsibleGroupBoxBasic:
Inheritance graph

Public Slots

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


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

Public Member Functions

 QgsCollapsibleGroupBoxBasic (QWidget *parent=0)
 QgsCollapsibleGroupBoxBasic (const QString &title, QWidget *parent=0)
 ~QgsCollapsibleGroupBoxBasic ()
bool isCollapsed () const
bool scrollOnExpand ()
void setCollapsed (bool collapse)
void setScrollOnExpand (bool scroll)
 set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded More...
void setSyncGroup (QString grp)
QString syncGroup () const
 Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. More...

Protected Member Functions

void changeEvent (QEvent *event) override
void clearModifiers ()
void collapseExpandFixes ()
 Visual fixes for when group box is collapsed/expanded. More...
void init ()
void mousePressEvent (QMouseEvent *event) override
void mouseReleaseEvent (QMouseEvent *event) override
void showEvent (QShowEvent *event) override
QRect titleRect () const
void updateStyle ()

Protected Attributes

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

Static Protected Attributes

static QIcon mCollapseIcon
static QIcon mExpandIcon

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

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.

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

Definition at line 39 of file qgscollapsiblegroupbox.cpp.

QgsCollapsibleGroupBoxBasic::~QgsCollapsibleGroupBoxBasic ( )

Definition at line 46 of file qgscollapsiblegroupbox.cpp.

Member Function Documentation

void QgsCollapsibleGroupBoxBasic::changeEvent ( QEvent *  event)

Definition at line 178 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::checkClicked ( bool  ckd)

Definition at line 223 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::checkToggled ( bool  ckd)

Definition at line 217 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::clearModifiers ( )

Definition at line 209 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::collapsedStateChanged ( bool  collapsed)

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

void QgsCollapsibleGroupBoxBasic::collapseExpandFixes ( )

Visual fixes for when group box is collapsed/expanded.

Definition at line 450 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::init ( )

Definition at line 51 of file qgscollapsiblegroupbox.cpp.

bool QgsCollapsibleGroupBoxBasic::isCollapsed ( ) const

Definition at line 84 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBoxBasic::mousePressEvent ( QMouseEvent *  event)

Definition at line 143 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::mouseReleaseEvent ( QMouseEvent *  event)

Definition at line 158 of file qgscollapsiblegroupbox.cpp.

bool QgsCollapsibleGroupBoxBasic::scrollOnExpand ( )

Definition at line 94 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBoxBasic::setCollapsed ( bool  collapse)

Definition at line 409 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::setScrollOnExpand ( bool  scroll)

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

Definition at line 92 of file qgscollapsiblegroupbox.h.

void QgsCollapsibleGroupBoxBasic::setSyncGroup ( QString  grp)

Definition at line 190 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::showEvent ( QShowEvent *  event)

Definition at line 90 of file qgscollapsiblegroupbox.cpp.

QString QgsCollapsibleGroupBoxBasic::syncGroup ( ) const

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

Definition at line 88 of file qgscollapsiblegroupbox.h.

QRect QgsCollapsibleGroupBoxBasic::titleRect ( ) const

Definition at line 201 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::toggleCollapsed ( )

Definition at line 235 of file qgscollapsiblegroupbox.cpp.

void QgsCollapsibleGroupBoxBasic::updateStyle ( )

Definition at line 311 of file qgscollapsiblegroupbox.cpp.

Member Data Documentation

bool QgsCollapsibleGroupBoxBasic::mAltDown

Definition at line 129 of file qgscollapsiblegroupbox.h.

QgsGroupBoxCollapseButton* QgsCollapsibleGroupBoxBasic::mCollapseButton

Definition at line 126 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mCollapsed

Definition at line 120 of file qgscollapsiblegroupbox.h.

QIcon QgsCollapsibleGroupBoxBasic::mCollapseIcon

Definition at line 133 of file qgscollapsiblegroupbox.h.

QIcon QgsCollapsibleGroupBoxBasic::mExpandIcon

Definition at line 134 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mInitFlat

Definition at line 121 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mInitFlatChecked

Definition at line 122 of file qgscollapsiblegroupbox.h.

QScrollArea* QgsCollapsibleGroupBoxBasic::mParentScrollArea

Definition at line 125 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mScrollOnExpand

Definition at line 123 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mShiftDown

Definition at line 130 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mShown

Definition at line 124 of file qgscollapsiblegroupbox.h.

QString QgsCollapsibleGroupBoxBasic::mSyncGroup

Definition at line 128 of file qgscollapsiblegroupbox.h.

QWidget* QgsCollapsibleGroupBoxBasic::mSyncParent

Definition at line 127 of file qgscollapsiblegroupbox.h.

bool QgsCollapsibleGroupBoxBasic::mTitleClicked

Definition at line 131 of file qgscollapsiblegroupbox.h.

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