/
qgseditformconfig.sip
299 lines (241 loc) · 8.36 KB
/
qgseditformconfig.sip
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
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditformconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsEditFormConfig
{
%TypeHeaderCode
#include "qgseditformconfig.h"
%End
public:
enum EditorLayout
{
GeneratedLayout,
TabLayout,
UiFileLayout
};
struct GroupData
{
GroupData();
%Docstring
Constructor for GroupData
%End
GroupData( const QString &name, const QList<QString> &fields );
QString mName;
QList<QString> mFields;
};
struct TabData
{
TabData();
%Docstring
Constructor for TabData
%End
TabData( const QString &name, const QList<QString> &fields, const QList<QgsEditFormConfig::GroupData> &groups );
QString mName;
QList<QString> mFields;
QList<QgsEditFormConfig::GroupData> mGroups;
};
enum FeatureFormSuppress
{
SuppressDefault,
SuppressOn,
SuppressOff
};
enum PythonInitCodeSource
{
CodeSourceNone,
CodeSourceFile,
CodeSourceDialog,
CodeSourceEnvironment
};
QgsEditFormConfig( const QgsEditFormConfig &o );
%Docstring
Copy constructor
.. versionadded:: 3.0
%End
~QgsEditFormConfig();
bool operator==( const QgsEditFormConfig &o );
void addTab( QgsAttributeEditorElement *data /Transfer/ );
%Docstring
Adds a new element to the invisible root container in the layout.
This is only useful in combination with EditorLayout.TabLayout.
%End
QList< QgsAttributeEditorElement * > tabs() const;
%Docstring
Returns a list of tabs for EditorLayout.TabLayout obtained from the invisible root container.
:rtype: list of QgsAttributeEditorElement
%End
void clearTabs();
%Docstring
Clears all the tabs for the attribute editor form with EditorLayout.TabLayout.
%End
QgsAttributeEditorContainer *invisibleRootContainer();
%Docstring
Get the invisible root container for the drag and drop designer form (EditorLayout.TabLayout).
.. versionadded:: 3
:rtype: QgsAttributeEditorContainer
%End
EditorLayout layout() const;
%Docstring
Get the active layout style for the attribute editor for this layer
:rtype: EditorLayout
%End
void setLayout( EditorLayout editorLayout );
%Docstring
Set the active layout style for the attribute editor for this layer
%End
QString uiForm() const;
%Docstring
Get path to the .ui form. Only meaningful with EditorLayout.UiFileLayout.
:rtype: str
%End
void setUiForm( const QString &ui );
%Docstring
Set path to the .ui form.
When a string is provided, the layout style will be set to EditorLayout.UiFileLayout,
if an empty or a null string is provided, the layout style will be set to
EditorLayout.GeneratedLayout.
%End
bool setWidgetConfig( const QString &widgetName, const QVariantMap &config );
%Docstring
Set the editor widget config for a widget which is not for a simple field.
Example:
\code{.py}
editFormConfig = layer.editFormConfig()
editFormConfig.setWidgetConfig( 'relation_id', { 'nm-rel': 'other_relation' } )
layer.setEditFormConfig(editFormConfig)
\endcode
\param widgetName The name of the widget to configure
\param config The config to set for this widget
:return: false if a field exists with the provided widgetName. In this case
QgsVectorLayer.setEditorWidgetSetup should be used.
.. seealso:: QgsVectorLayer.setEditorWidgetSetup() for field configurations.
:rtype: bool
%End
QVariantMap widgetConfig( const QString &widgetName ) const;
%Docstring
Get the configuration for the editor widget with the given name.
\param widgetName The name of the widget.
:return: The configuration for the editor widget or an empty config if the field does not exist
:rtype: QVariantMap
%End
bool removeWidgetConfig( const QString &widgetName );
%Docstring
Remove the configuration for the editor widget with the given name
\param widgetName The name of the widget.
:return: true if a configuration has been removed
:rtype: bool
%End
bool readOnly( int idx ) const;
%Docstring
This returns true if the field is manually set to read only or if the field
does not support editing like joins or virtual fields.
:rtype: bool
%End
void setReadOnly( int idx, bool readOnly = true );
%Docstring
If set to false, the widget at the given index will be read-only.
%End
bool labelOnTop( int idx ) const;
%Docstring
If this returns true, the widget at the given index will receive its label on the previous line
while if it returns false, the widget will receive its label on the left hand side.
Labeling on top leaves more horizontal space for the widget itself.
*
:rtype: bool
%End
void setLabelOnTop( int idx, bool onTop );
%Docstring
If this is set to true, the widget at the given index will receive its label on
the previous line while if it is set to false, the widget will receive its label
on the left hand side.
Labeling on top leaves more horizontal space for the widget itself.
*
%End
QString initFunction() const;
%Docstring
Get Python function for edit form initialization.
Will be looked up in a Python file relative to the project folder if it
includes a module name or if it's a pure function name it will searched
in the Python code set with setInitCode().
:rtype: str
%End
void setInitFunction( const QString &function );
%Docstring
Set Python function for edit form initialization.
Will be looked up in a Python file relative to the project folder if it
includes a module name or if it's a pure function name it will searched
in the Python code set with setInitCode().
%End
QString initCode() const;
%Docstring
Get Python code for edit form initialization.
:rtype: str
%End
void setInitCode( const QString &code );
%Docstring
Set Python code for edit form initialization.
Make sure that you also set the appropriate function name in
setInitFunction().
%End
QString initFilePath() const;
%Docstring
Get Python external file path for edit form initialization.
:rtype: str
%End
void setInitFilePath( const QString &filePath );
%Docstring
Set Python external file path for edit form initialization.
Make sure that you also set the appropriate function name in
setInitFunction().
%End
PythonInitCodeSource initCodeSource() const;
%Docstring
Return Python code source for edit form initialization
(if it shall be loaded from a file, read from the
provided dialog editor or inherited from the environment)
:rtype: PythonInitCodeSource
%End
void setInitCodeSource( PythonInitCodeSource initCodeSource );
%Docstring
Set if Python code shall be used for edit form initialization and its origin
%End
FeatureFormSuppress suppress() const;
%Docstring
Type of feature form pop-up suppression after feature creation (overrides app setting)
:rtype: FeatureFormSuppress
%End
void setSuppress( FeatureFormSuppress s );
%Docstring
Set type of feature form pop-up suppression after feature creation (overrides app setting)
%End
void readXml( const QDomNode &node, const QgsReadWriteContext &context );
%Docstring
Read XML information
Deserialize on project load
%End
void writeXml( QDomNode &node, const QgsReadWriteContext &context ) const;
%Docstring
Write XML information
Serialize on project save
%End
QgsAttributeEditorElement *attributeEditorElementFromDomElement( QDomElement &elem, QgsAttributeEditorElement *parent );
%Docstring
Deserialize drag and drop designer elements.
:rtype: QgsAttributeEditorElement
%End
explicit QgsEditFormConfig();
%Docstring
Create a new edit form config. Normally invoked by QgsVectorLayer
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditformconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/