1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgscollapsiblegroupbox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsGroupBoxCollapseButton : QToolButton
{
%TypeHeaderCode
#include "qgscollapsiblegroupbox.h"
%End
public:
QgsGroupBoxCollapseButton( QWidget *parent /TransferThis/ = 0 );
bool altDown() const;
void setAltDown( bool updown );
bool shiftDown() const;
void setShiftDown( bool shiftdown );
protected:
virtual void mouseReleaseEvent( QMouseEvent *event );
};
class QgsCollapsibleGroupBoxBasic : QGroupBox
{
%Docstring(signature="appended")
A groupbox that collapses/expands when toggled. Basic class
:py: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, bool scrollOnExpand
%End
%TypeHeaderCode
#include "qgscollapsiblegroupbox.h"
%End
public:
QgsCollapsibleGroupBoxBasic( QWidget *parent /TransferThis/ = 0 );
QgsCollapsibleGroupBoxBasic( const QString &title, QWidget *parent /TransferThis/ = 0 );
bool isCollapsed() const;
%Docstring
Returns the current collapsed state of this group box
%End
void setCollapsed( bool collapse );
%Docstring
Collapse or uncollapse this groupbox
:param collapse: Will collapse on ``True`` and uncollapse on ``False``
%End
QString syncGroup() const;
%Docstring
Named group which synchronizes collapsing action when triangle is
clicked while holding alt modifier key
%End
void setSyncGroup( const QString &grp );
%Docstring
Named group which synchronizes collapsing action when triangle is
clicked while holding alt modifier key
%End
void setScrollOnExpand( bool scroll );
%Docstring
Sets this to ``False`` to not automatically scroll parent QScrollArea to
this widget's contents when expanded
%End
bool scrollOnExpand();
%Docstring
If this is set to ``False`` the parent QScrollArea will not be
automatically scrolled to this widget's contents when expanded
%End
signals:
void collapsedStateChanged( bool collapsed );
%Docstring
Signal emitted when groupbox collapsed/expanded state is changed, and
when first shown
%End
public slots:
void checkToggled( bool ckd );
void checkClicked( bool ckd );
void toggleCollapsed();
void setStyleSheet( const QString &style );
%Docstring
Overridden to prepare base call and avoid crash due to specific QT
versions
.. versionadded:: 3.16
%End
protected:
void collapseExpandFixes();
%Docstring
Visual fixes for when group box is collapsed/expanded
%End
virtual void showEvent( QShowEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );
virtual void changeEvent( QEvent *event );
void updateStyle();
QRect titleRect() const;
void clearModifiers();
};
class QgsCollapsibleGroupBox : QgsCollapsibleGroupBoxBasic
{
%Docstring(signature="appended")
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
.. seealso:: :py: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 properties palette:
bool collapsed, bool saveCollapsedState, bool saveCheckedState, QString syncGroup
%End
%TypeHeaderCode
#include "qgscollapsiblegroupbox.h"
%End
public:
QgsCollapsibleGroupBox( QWidget *parent /TransferThis/ = 0, QgsSettings *settings = 0 );
QgsCollapsibleGroupBox( const QString &title, QWidget *parent /TransferThis/ = 0, QgsSettings *settings = 0 );
~QgsCollapsibleGroupBox();
void setSettings( QgsSettings *settings );
void setSaveCollapsedState( bool save );
%Docstring
Sets this to ``False`` to not save/restore collapsed state
%End
void setSaveCheckedState( bool save );
%Docstring
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
%End
bool saveCollapsedState();
bool saveCheckedState();
void setSettingGroup( const QString &group );
%Docstring
Sets this to a defined string to share save/restore states across
different parent dialogs
%End
QString settingGroup() const;
%Docstring
Returns the name of the setting group in which the collapsed state will
be saved
%End
protected slots:
void loadState();
%Docstring
Will load the collapsed and checked state
The configuration path from which it is loaded is defined by
- The object name
- The settingGroup
%End
void saveState() const;
%Docstring
Will save the collapsed and checked state
The configuration path to which it is saved is defined by
- The object name
- The settingGroup
%End
protected:
virtual void showEvent( QShowEvent *event );
QString saveKey() const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgscollapsiblegroupbox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|