File: qgsattributeform.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 (333 lines) | stat: -rw-r--r-- 8,415 bytes parent folder | download | duplicates (6)
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsattributeform.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/







class QgsAttributeForm : QWidget
{

%TypeHeaderCode
#include "qgsattributeform.h"
%End
  public:
    enum Mode /BaseType=IntEnum/
    {
      SingleEditMode,
      AddFeatureMode,
      MultiEditMode,
      SearchMode,
      AggregateSearchMode,
      IdentifyMode
    };

    enum FilterType /BaseType=IntEnum/
    {
      ReplaceFilter,
      FilterAnd,
      FilterOr,
    };

    explicit QgsAttributeForm( QgsVectorLayer *vl, const QgsFeature &feature = QgsFeature(), const QgsAttributeEditorContext &context = QgsAttributeEditorContext(), QWidget *parent /TransferThis/ = 0 );
    ~QgsAttributeForm();

    const QgsFeature &feature();

    QgsFeature currentFormFeature() const;
%Docstring
Returns the feature that is currently displayed in the form with all the
changes received on editing the values in the widgets.

.. versionadded:: 3.16
%End

    void displayWarning( const QString &message );
%Docstring
Displays a warning message in the form message bar

:param message: message string

.. seealso:: :py:func:`mode`

.. versionadded:: 3.12
%End


    void hideButtonBox();
%Docstring
Hides the button box (OK/Cancel) and enables auto-commit

.. note::

   set Embed in :py:class:`QgsAttributeEditorContext` in constructor instead
%End


    void showButtonBox();
%Docstring
Shows the button box (OK/Cancel) and disables auto-commit

.. note::

   set Embed in :py:class:`QgsAttributeEditorContext` in constructor instead
%End


    void disconnectButtonBox();
%Docstring
Disconnects the button box (OK/Cancel) from the accept/resetValues slots
If this method is called, you have to create these connections from
outside
%End

    void addInterface( QgsAttributeFormInterface *iface /Transfer/ );
%Docstring
Takes ownership

:param iface: 
%End

    QgsVectorLayer *layer();
%Docstring
Returns the layer for which this form is shown

:return: Layer
%End

    bool editable();
%Docstring
Returns if the form is currently in editable mode.

:return: Editable mode of this form
%End

    QgsAttributeEditorContext::Mode mode() const;
%Docstring
Returns the current mode of the form.

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

    void setMode( QgsAttributeEditorContext::Mode mode );
%Docstring
Sets the current mode of the form.

:param mode: form mode

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

    void setEditCommandMessage( const QString &message );
%Docstring
Sets the edit command message (Undo) that will be used when the dialog
is accepted

:param message: The message
%End

    virtual bool eventFilter( QObject *object, QEvent *event );

%Docstring
Intercepts keypress on custom form (escape should not close it)

:param object: The object for which the event has been sent
:param event: The event which is being filtered

:return: ``True`` if the event has been handled (key was ESC)
%End

    void setMultiEditFeatureIds( const QgsFeatureIds &fids );
%Docstring
Sets all feature IDs which are to be edited if the form is in multiedit
mode

:param fids: feature ID list
%End

    void setMessageBar( QgsMessageBar *messageBar );
%Docstring
Sets the message bar to display feedback from the form in. This is used
in the search/filter mode to display the count of selected features.

:param messageBar: target message bar
%End

    QString aggregateFilter() const;
%Docstring
The aggregate filter is only useful if the form is in AggregateFilter
mode. In this case it will return a combined expression according to the
chosen filters on all attribute widgets.
%End

    void setExtraContextScope( QgsExpressionContextScope *extraScope /Transfer/ );
%Docstring
Sets an additional expression context scope to be used for calculations
in this form.

.. versionadded:: 3.16
%End

    bool needsGeometry() const;
%Docstring
Returns ``True`` if any of the form widgets need feature geometry

.. versionadded:: 3.20
%End

  signals:

 void attributeChanged( const QString &attribute, const QVariant &value ) /Deprecated/;
%Docstring
Notifies about changes of attributes, this signal is not emitted when
the value is set back to the original one.

:param attribute: The name of the attribute that changed.
:param value: The new value of the attribute.

.. deprecated:: 3.0
%End

    void widgetValueChanged( const QString &attribute, const QVariant &value, bool attributeChanged );
%Docstring
Notifies about changes of attributes

:param attribute: The name of the attribute that changed.
:param value: The new value of the attribute.
:param attributeChanged: If ``True``, it corresponds to an actual change
                         of the feature attribute
%End


    void featureSaved( const QgsFeature &feature );
%Docstring
Emitted when a feature is changed or added
%End

    void filterExpressionSet( const QString &expression, QgsAttributeForm::FilterType type );
%Docstring
Emitted when a filter expression is set using the form.

:param expression: filter expression
:param type: filter type
%End

    void modeChanged( QgsAttributeEditorContext::Mode mode );
%Docstring
Emitted when the form changes mode.

:param mode: new mode
%End

    void closed();
%Docstring
Emitted when the user selects the close option from the form's button
bar.
%End

    void zoomToFeatures( const QString &filter );
%Docstring
Emitted when the user chooses to zoom to a filtered set of features.
%End

    void flashFeatures( const QString &filter );
%Docstring
Emitted when the user chooses to flash a filtered set of features.
%End

    void openFilteredFeaturesAttributeTable( const QString &filter );
%Docstring
Emitted when the user chooses to open the attribute table dialog with a
filtered set of features.

.. versionadded:: 3.24
%End

  public slots:

    void changeAttribute( const QString &field, const QVariant &value, const QString &hintText = QString() );
%Docstring
Call this to change the content of a given attribute. Will update the
editor(s) related to this field.

:param field: The field to change
:param value: The new value
:param hintText: A hint text for non existent joined features
%End

    void changeGeometry( const QgsGeometry &geometry );
%Docstring
Changes the ``geometry`` of the feature attached to the form.

.. versionadded:: 3.30
%End

    void setFeature( const QgsFeature &feature );
%Docstring
Update all editors to correspond to a different feature.

:param feature: The feature which will be represented by the form
%End

    bool save();
%Docstring
Save all the values from the editors to the layer.

:return: ``True`` if successful
%End

    bool saveWithDetails( QString *error /Out/ = 0 );
%Docstring
Save all the values from the editors to the layer.



:return: - ``True`` if save was successful
         - error: an explanatory error message if an error occurs while
           saving the form.

.. versionadded:: 3.18
%End

    void resetValues();
%Docstring
Sets all values to the values of the current feature
%End

    void resetSearch();
%Docstring
Resets the search/filter form values.
%End

    void refreshFeature();
%Docstring
reload current feature
%End

    void parentFormValueChanged( const QString &attribute, const QVariant &newValue );
%Docstring
Is called in embedded forms when an ``attribute`` value in the parent
form has changed to ``newValue``.

Notify the form widgets that something has changed in case they have
filter expressions that depend on the parent form scope.

.. versionadded:: 3.14
%End

};

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