File: qgspropertyoverridebutton.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (258 lines) | stat: -rw-r--r-- 8,419 bytes parent folder | download | duplicates (12)
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgspropertyoverridebutton.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsPropertyOverrideButton : QToolButton
{
%Docstring(signature="appended")
A button for controlling property overrides which may apply to a widget.

:py:class:`QgsPropertyOverrideButton` is designed to be used alongside
the QGIS properties framework (:py:class:`QgsProperty`,
:py:class:`QgsPropertyDefinition` and
:py:class:`QgsPropertyCollection`).

It allows users to specify field or expression based overrides which
should be applied to a property of an object. Eg, this widget is used
for controlling data defined overrides in symbology, labeling and
layouts.
%End

%TypeHeaderCode
#include "qgspropertyoverridebutton.h"
%End
  public:
    QgsPropertyOverrideButton( QWidget *parent /TransferThis/ = 0, const QgsVectorLayer *layer = 0 );
%Docstring
Constructor for QgsPropertyOverrideButton.

:param parent: parent widget
:param layer: associated vector layer
%End

    void init( int propertyKey, const QgsProperty &property, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer = 0, bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was
included in a UI layout).

:param propertyKey: key for corresponding property
:param property: initial value of associated property to show in widget
:param definitions: properties definitions for corresponding collection
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If ``True``, activate the button to
                                store data defined in auxiliary storage
%End

    void init( int propertyKey, const QgsProperty &property, const QgsPropertyDefinition &definition, const QgsVectorLayer *layer = 0, bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was
included in a UI layout).

:param propertyKey: key for corresponding property
:param property: initial value of associated property to show in widget
:param definition: properties definition for button
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If ``True``, activate the button to
                                store data defined in auxiliary storage
%End

    void init( int propertyKey, const QgsAbstractPropertyCollection &collection, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer = 0, bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was
included in a UI layout).

:param propertyKey: key for corresponding property
:param collection: associated property collection
:param definitions: properties definitions for collection
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If ``True``, activate the button to
                                store data defined in auxiliary storage
%End

    QgsProperty toProperty() const;
%Docstring
Returns a :py:class:`QgsProperty` object encapsulating the current state
of the widget.

.. seealso:: :py:func:`setToProperty`
%End

    void setToProperty( const QgsProperty &property );
%Docstring
Sets the widget to reflect the current state of a
:py:class:`QgsProperty`.
%End

    int propertyKey() const;
%Docstring
Returns the property key linked to the button.
%End

    bool isActive() const;
%Docstring
Returns ``True`` if the button has an active property.
%End

    QgsPropertyDefinition::DataType validDataType() const;
%Docstring
Returns the data type which the widget will accept. This is used to
filter out fields from the associated vector layer to only show fields
which are compatible with the property.
%End

    QString fullDescription() const;
%Docstring
Returns the full definition description and current definition
(internally generated on a contextual basis).
%End

    QString usageInfo() const;
%Docstring
Returns usage information for the property.

.. seealso:: :py:func:`setUsageInfo`
%End

    void setUsageInfo( const QString &info );
%Docstring
Set the usage information for the property.

.. seealso:: :py:func:`usageInfo`
%End

    void setVectorLayer( const QgsVectorLayer *layer );
%Docstring
Sets the vector layer associated with the button. This controls which
fields are displayed within the widget's pop up menu.

.. seealso:: :py:func:`vectorLayer`
%End

    const QgsVectorLayer *vectorLayer() const;
%Docstring
Returns the vector layer associated with the button. This controls which
fields are displayed within the widget's pop up menu.

.. seealso:: :py:func:`setVectorLayer`
%End

    void registerCheckedWidget( QWidget *widget, bool natural = true );
%Docstring
Register a sibling ``widget`` that gets checked when the property is
active. if ``natural`` is ``False``, widget gets unchecked when the
property is active.

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerEnabledWidget( QWidget *widget, bool natural = true );
%Docstring
Register a sibling ``widget`` that gets enabled when the property is
active, and disabled when the property is inactive. if ``natural`` is
``False``, widget gets disabled when the property is active, and enabled
when the property is inactive.

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerVisibleWidget( QWidget *widget, bool natural = true );
%Docstring
Register a sibling ``widget`` that gets visible when the property is
active, and hidden when the property is inactive. if ``natural`` is
``False``, widget gets hidden when the property is active, and visible
when the property is inactive.

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerExpressionWidget( QWidget *widget );
%Docstring
Register a sibling ``widget`` (line edit, text edit) that will receive
the property as an expression

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator );
%Docstring
Register an expression context generator class that will be used to
retrieve an expression context for the button when required.
%End

    void registerLinkedWidget( QWidget *widget );
%Docstring
Registers a ``widget`` which is linked to this button. The meaning of
linked widgets depends on the property type, and the type of linked
widget.

For color properties, linking a :py:class:`QgsColorButton` allows the
color button to correctly reflect the status of the property when it's
set to follow a project color.

.. versionadded:: 3.6
%End

    void updateFieldLists();
%Docstring
Updates list of fields.
%End


  public slots:

    void setActive( bool active );
%Docstring
Set whether the current property override definition is to be used
%End



    void aboutToShowMenu();
    void menuActionTriggered( QAction *action );


  signals:

    void changed();
%Docstring
Emitted when property definition changes
%End

    void activated( bool isActive );
%Docstring
Emitted when the activated status of the widget changes
%End

    void createAuxiliaryField();
%Docstring
Emitted when creating a new auxiliary field
%End

  protected:
    virtual void mouseReleaseEvent( QMouseEvent *event );


};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgspropertyoverridebutton.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/