QGIS/python/gui/qgscollapsiblegroupbox.sip
Larry Shaffer 1095f98173 Add option to use custom QSettings for QgsCollapsibleGroupBox
- Useful for plugins that may want to store collapsed state in their own QSettings file
2013-02-02 17:16:37 -07:00

56 lines
1.8 KiB
Plaintext

class QgsCollapsibleGroupBox : QGroupBox
{
%TypeHeaderCode
#include <qgscollapsiblegroupbox.h>
%End
public:
QgsCollapsibleGroupBox( QWidget *parent = 0, QSettings* settings = 0 );
QgsCollapsibleGroupBox( const QString &title, QWidget *parent = 0, QSettings* settings = 0 );
~QgsCollapsibleGroupBox();
// set custom QSettings pointer if group box was already created from QtDesigner promotion
void setSettings( QSettings* settings );
bool isCollapsed() const;
void setCollapsed( bool collapse );
//! set this to false to not save/restore collapsed state
void setSaveCollapsedState( bool save );
/** 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 */
void setSaveCheckedState( bool save );
bool saveCollapsedState();
bool saveCheckedState();
//! set this to a defined string to share save/restore collapsed state across dialogs
void setSettingGroup( const QString &group );
QString settingGroup() const;
//! set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
void setScrollOnExpand( bool scroll );
signals:
/** Signal emitted when groupbox collapsed/expanded state is changed, and when first shown */
void collapsedStateChanged( QgsCollapsibleGroupBox* );
public slots:
void checkToggled( bool ckd );
void toggleCollapsed();
protected slots:
void loadState();
void saveState();
protected:
void init();
void showEvent( QShowEvent *event );
void mouseReleaseEvent( QMouseEvent *event );
void changeEvent( QEvent *event );
void updateStyle();
QRect titleRect() const;
QString saveKey() const;
};