-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsattributeeditorelement.sip.in
564 lines (411 loc) · 13.8 KB
/
qgsattributeeditorelement.sip.in
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributeeditorelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeEditorElement /Abstract/
{
%Docstring
This is an abstract base class for any elements of a drag and drop form.
This can either be a container which will be represented on the screen
as a tab widget or a collapsible group box. Or it can be a field which will
then be represented based on the QgsEditorWidget type and configuration.
Or it can be a relation and embed the form of several children of another
layer.
%End
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
%ConvertToSubClassCode
switch ( sipCpp->type() )
{
case QgsAttributeEditorElement::AeTypeContainer:
sipType = sipType_QgsAttributeEditorContainer;
break;
case QgsAttributeEditorElement::AeTypeField:
sipType = sipType_QgsAttributeEditorField;
break;
case QgsAttributeEditorElement::AeTypeRelation:
sipType = sipType_QgsAttributeEditorRelation;
break;
default:
sipType = nullptr;
break;
}
%End
public:
enum AttributeEditorType
{
AeTypeContainer,
AeTypeField,
AeTypeRelation,
AeTypeInvalid,
AeTypeQmlElement,
AeTypeHtmlElement
};
QgsAttributeEditorElement( AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent = 0 );
%Docstring
Constructor
:param type: The type of the new element.
:param name:
:param parent:
%End
virtual ~QgsAttributeEditorElement();
QString name() const;
%Docstring
Returns the name of this element
:return: The name for this element
%End
AttributeEditorType type() const;
%Docstring
The type of this element
:return: The type
%End
QgsAttributeEditorElement *parent() const;
%Docstring
Gets the parent of this element.
.. versionadded:: 3.0
%End
QDomElement toDomElement( QDomDocument &doc ) const;
%Docstring
Gets the XML Dom element to save this element.
:param doc: The QDomDocument which is used to create new XML elements
:return: A DOM element to serialize this element
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const = 0 /Factory/;
%Docstring
Returns a clone of this element. To be implemented by subclasses.
.. versionadded:: 3.0
%End
bool showLabel() const;
%Docstring
Controls if this element should be labeled with a title (field, relation or groupname).
.. versionadded:: 2.18
%End
void setShowLabel( bool showLabel );
%Docstring
Controls if this element should be labeled with a title (field, relation or groupname).
.. versionadded:: 2.18
%End
protected:
};
class QgsAttributeEditorContainer : QgsAttributeEditorElement
{
%Docstring
This is a container for attribute editors, used to group them visually in the
attribute form if it is set to the drag and drop designer.
%End
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
public:
QgsAttributeEditorContainer( const QString &name, QgsAttributeEditorElement *parent, const QColor &backgroundColor = QColor() );
%Docstring
Creates a new attribute editor container
:param name: The name to show as title
:param parent: The parent. May be another container.
:param backgroundColor: The optional background color of the container.
%End
~QgsAttributeEditorContainer();
virtual void addChildElement( QgsAttributeEditorElement *element /Transfer/ );
%Docstring
Add a child element to this container. This may be another container, a field or a relation.
:param element: The element to add as child
%End
virtual void setIsGroupBox( bool isGroupBox );
%Docstring
Determines if this container is rendered as collapsible group box or tab in a tabwidget
:param isGroupBox: If ``True``, this will be a group box
%End
virtual bool isGroupBox() const;
%Docstring
Returns if this container is going to be rendered as a group box
:return: ``True`` if it will be a group box, ``False`` if it will be a tab
%End
QList<QgsAttributeEditorElement *> children() const;
%Docstring
Gets a list of the children elements of this container
:return: A list of elements
%End
virtual QList<QgsAttributeEditorElement *> findElements( AttributeEditorType type ) const;
%Docstring
Traverses the element tree to find any element of the specified type
:param type: The type which should be searched
:return: A list of elements of the type which has been searched for
%End
void clear();
%Docstring
Clear all children from this container.
%End
void setName( const QString &name );
%Docstring
Change the name of this container
%End
int columnCount() const;
%Docstring
Gets the number of columns in this group
%End
void setColumnCount( int columnCount );
%Docstring
Set the number of columns in this group
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
%Docstring
Creates a deep copy of this element. To be implemented by subclasses.
.. versionadded:: 3.0
%End
QgsOptionalExpression visibilityExpression() const;
%Docstring
The visibility expression is used in the attribute form to
show or hide this container based on an expression incorporating
the field value controlled by editor widgets.
.. versionadded:: 3.0
%End
void setVisibilityExpression( const QgsOptionalExpression &visibilityExpression );
%Docstring
The visibility expression is used in the attribute form to
show or hide this container based on an expression incorporating
the field value controlled by editor widgets.
.. versionadded:: 3.0
%End
QColor backgroundColor() const;
%Docstring
backgroundColor
:return: background color of the container
.. versionadded:: 3.8
%End
void setBackgroundColor( const QColor &backgroundColor );
%Docstring
Sets the background color to ``backgroundColor``
%End
};
class QgsAttributeEditorField : QgsAttributeEditorElement
{
%Docstring
This element will load a field's widget onto the form.
%End
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
public:
QgsAttributeEditorField( const QString &name, int idx, QgsAttributeEditorElement *parent );
%Docstring
Creates a new attribute editor element which represents a field
:param name: The name of the element
:param idx: The index of the field which should be embedded
:param parent: The parent of this widget (used as container)
%End
int idx() const;
%Docstring
Returns the index of the field.
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
};
class QgsAttributeEditorRelation : QgsAttributeEditorElement
{
%Docstring
This element will load a relation editor onto the form.
%End
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
enum Button
{
Link,
Unlink,
SaveChildEdits,
AddChildFeature,
DuplicateChildFeature,
DeleteChildFeature,
ZoomToChildFeature,
AllButtons
};
typedef QFlags<QgsAttributeEditorRelation::Button> Buttons;
QgsAttributeEditorRelation( const QString &name, const QString &relationId, QgsAttributeEditorElement *parent );
%Docstring
.. deprecated:: QGIS 3.0.2.
The name parameter is not used for anything and overwritten by the relationId internally.
%End
QgsAttributeEditorRelation( const QString &name, const QgsRelation &relation, QgsAttributeEditorElement *parent );
%Docstring
.. deprecated:: QGIS 3.0.2.
The name parameter is not used for anything and overwritten by the relationId internally.
%End
QgsAttributeEditorRelation( const QString &relationId, QgsAttributeEditorElement *parent );
%Docstring
Creates a new element which embeds a relation.
:param relationId: The id of the relation to embed
:param parent: The parent (used as container)
%End
QgsAttributeEditorRelation( const QgsRelation &relation, QgsAttributeEditorElement *parent );
%Docstring
Creates a new element which embeds a relation.
:param relation: The relation to embed
:param parent: The parent (used as container)
%End
const QgsRelation &relation() const;
%Docstring
Gets the id of the relation which shall be embedded
:return: the id
%End
bool init( QgsRelationManager *relManager );
%Docstring
Initializes the relation from the id
:param relManager: The relation manager to use for the initialization
:return: ``True`` if the relation was found in the relationmanager
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
bool showLinkButton() const /Deprecated/;
%Docstring
Determines if the "link feature" button should be shown
.. versionadded:: 2.18
.. deprecated:: QGIS 3.16
use visibleButtons() instead
%End
void setShowLinkButton( bool showLinkButton ) /Deprecated/;
%Docstring
Determines if the "link feature" button should be shown
.. versionadded:: 2.18
.. deprecated:: QGIS 3.16
use setVisibleButtons() instead
%End
bool showUnlinkButton() const /Deprecated/;
%Docstring
Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18
.. deprecated:: QGIS 3.16
use visibleButtons() instead
%End
void setShowUnlinkButton( bool showUnlinkButton ) /Deprecated/;
%Docstring
Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18
.. deprecated:: QGIS 3.16
use setVisibleButtons() instead
%End
void setShowSaveChildEditsButton( bool showChildEdits ) /Deprecated/;
%Docstring
Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14
.. deprecated:: QGIS 3.16
use setVisibleButtons() instead
%End
bool showSaveChildEditsButton() const /Deprecated/;
%Docstring
Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14
.. deprecated:: QGIS 3.16
use visibleButtons() instead
%End
void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons );
%Docstring
Defines the buttons which are shown
.. versionadded:: 3.16
%End
QgsAttributeEditorRelation::Buttons visibleButtons() const;
%Docstring
Returns the buttons which are shown
.. versionadded:: 3.16
%End
bool forceSuppressFormPopup() const;
%Docstring
Determines the force suppress form popup status.
.. versionadded:: 3.16
%End
void setForceSuppressFormPopup( bool forceSuppressFormPopup );
%Docstring
Sets force suppress form popup status to ``forceSuppressFormPopup``.
This flag is to override the layer and general settings regarding the automatic
opening of the attribute form dialog when digitizing is completed.
.. versionadded:: 3.16
%End
QVariant nmRelationId() const;
%Docstring
Determines the relation id of the second relation involved in an N:M relation.
.. versionadded:: 3.16
%End
void setNmRelationId( const QVariant &nmRelationId = QVariant() );
%Docstring
Sets ``nmRelationId`` for the relation id of the second relation involved in an N:M relation.
If it's empty, then it's considered as a 1:M relationship.
.. versionadded:: 3.16
%End
QString label() const;
%Docstring
Determines the label of this element
.. versionadded:: 3.16
%End
void setLabel( const QString &label = QString() );
%Docstring
Sets ``label`` for this element
If it's empty it takes the relation id as label
.. versionadded:: 3.16
%End
};
QFlags<QgsAttributeEditorRelation::Button> operator|(QgsAttributeEditorRelation::Button f1, QFlags<QgsAttributeEditorRelation::Button> f2);
class QgsAttributeEditorQmlElement : QgsAttributeEditorElement
{
%Docstring
An attribute editor widget that will represent arbitrary QML code.
.. versionadded:: 3.4
%End
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
public:
QgsAttributeEditorQmlElement( const QString &name, QgsAttributeEditorElement *parent );
%Docstring
Creates a new element which can display QML
:param name: The name of the widget
:param parent: The parent (used as container)
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
QString qmlCode() const;
%Docstring
The QML code that will be represented within this widget.
.. versionadded:: 3.4
%End
void setQmlCode( const QString &qmlCode );
%Docstring
Sets the QML code that will be represented within this widget to ``qmlCode``.
%End
};
class QgsAttributeEditorHtmlElement : QgsAttributeEditorElement
{
%Docstring
An attribute editor widget that will represent arbitrary HTML code.
.. versionadded:: 3.8
%End
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
public:
QgsAttributeEditorHtmlElement( const QString &name, QgsAttributeEditorElement *parent );
%Docstring
Creates a new element which can display HTML
:param name: The name of the widget
:param parent: The parent (used as container)
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
QString htmlCode() const;
%Docstring
The QML code that will be represented within this widget.
.. versionadded:: 3.4
%End
void setHtmlCode( const QString &htmlCode );
%Docstring
Sets the HTML code that will be represented within this widget to ``htmlCode``.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributeeditorelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/