3333
3434class FormFieldWidget :
3535 def __init__ (self , name : str , field_name : str ) -> None :
36+ """
37+ Description to do
38+
39+ Args:
40+ name (str): Description to do.
41+ field_name (str): Description to do.
42+
43+ Returns:
44+ None: Description to do.
45+ """
46+
3647 self .name = name if name else field_name
3748 self .field_name = field_name
3849
3950 def create (
4051 self , parent : QgsAttributeEditorElement , layer : QgsVectorLayer
4152 ) -> QgsAttributeEditorField :
53+ """
54+ Description to do
55+
56+ Args:
57+ parent (QgsAttributeEditorElement): Description to do.
58+ layer (QgsVectorLayer): Description to do.
59+
60+ Returns:
61+ QgsAttributeEditorField: Description to do.
62+ """
63+
4264 index = layer .fields ().indexOf (self .field_name )
4365 widget = QgsAttributeEditorField (self .field_name , index , parent )
4466 return widget
@@ -48,12 +70,34 @@ class FormRelationWidget:
4870 def __init__ (
4971 self , relation : Relation , nm_relation : Optional [Relation ] = None
5072 ) -> None :
73+ """
74+ Description to do
75+
76+ Args:
77+ relation (Relation): Description to do.
78+ nm_relation (Optional[Relation]): Description to do.
79+
80+ Returns:
81+ None: Description to do.
82+ """
83+
5184 self .relation = relation
5285 self .nm_relation = nm_relation
5386
5487 def create (
5588 self , parent : QgsAttributeEditorElement , _layer
5689 ) -> QgsAttributeEditorRelation :
90+ """
91+ Description to do
92+
93+ Args:
94+ parent (QgsAttributeEditorElement): Description to do.
95+ _layer (TYPE): Description to do.
96+
97+ Returns:
98+ QgsAttributeEditorRelation: Description to do.
99+ """
100+
57101 try :
58102 widget = QgsAttributeEditorRelation (self .relation .id , parent )
59103 except TypeError :
@@ -77,16 +121,48 @@ def create(
77121
78122class FormTab :
79123 def __init__ (self , name : str , columns : int = 1 ) -> None :
124+ """
125+ Description to do
126+
127+ Args:
128+ name (str): Description to do.
129+ columns (int): Description to do.
130+
131+ Returns:
132+ None: Description to do.
133+ """
134+
80135 self .name = name
81136 self .children = list ()
82137 self .columns = columns
83138
84139 def addChild (self , child : Union [FormFieldWidget , FormRelationWidget ]) -> None :
140+ """
141+ Description to do
142+
143+ Args:
144+ child (Union[FormFieldWidget, FormRelationWidget]): Description to do.
145+
146+ Returns:
147+ None: Description to do.
148+ """
149+
85150 self .children .append (child )
86151
87152 def create (
88153 self , parent : QgsAttributeEditorElement , layer : QgsVectorLayer
89154 ) -> QgsAttributeEditorContainer :
155+ """
156+ Description to do
157+
158+ Args:
159+ parent (QgsAttributeEditorElement): Description to do.
160+ layer (QgsVectorLayer): Description to do.
161+
162+ Returns:
163+ QgsAttributeEditorContainer: Description to do.
164+ """
165+
90166 container = QgsAttributeEditorContainer (self .name , parent )
91167 container .setIsGroupBox (False )
92168 container .setColumnCount (self .columns )
@@ -98,14 +174,40 @@ def create(
98174
99175class Form :
100176 def __init__ (self ) -> None :
177+ """
178+ Description to do
179+
180+ Returns:
181+ None: Description to do.
182+ """
183+
101184 self .__elements = list ()
102185
103186 def elements (self ) -> list [Union [FormFieldWidget , FormRelationWidget ]]:
187+ """
188+ Description to do
189+
190+ Returns:
191+ list[Union[FormFieldWidget, FormRelationWidget]]: Description to do.
192+ """
193+
104194 return self .__elements
105195
106196 def create (
107197 self , layer : Layer , qgis_layer : QgsVectorLayer , project : Project
108198 ) -> QgsEditFormConfig :
199+ """
200+ Description to do
201+
202+ Args:
203+ layer (Layer): Description to do.
204+ qgis_layer (QgsVectorLayer): Description to do.
205+ project (Project): Description to do.
206+
207+ Returns:
208+ QgsEditFormConfig: Description to do.
209+ """
210+
109211 edit_form_config = qgis_layer .editFormConfig ()
110212 root_container = edit_form_config .invisibleRootContainer ()
111213 root_container .clear ()
@@ -131,19 +233,61 @@ def create(
131233 return edit_form_config
132234
133235 def add_element (self , element : Union [FormTab , FormFieldWidget ]) -> None :
236+ """
237+ Description to do
238+
239+ Args:
240+ element (Union[FormTab, FormFieldWidget]): Description to do.
241+
242+ Returns:
243+ None: Description to do.
244+ """
245+
134246 self .__elements .append (element )
135247
136248
137249class FormGroupBox :
138250 def __init__ (self , name : str , columns : int = 1 ) -> None :
251+ """
252+ Description to do
253+
254+ Args:
255+ name (str): Description to do.
256+ columns (int): Description to do.
257+
258+ Returns:
259+ None: Description to do.
260+ """
261+
139262 self .name = name
140263 self .children = list ()
141264 self .columns = columns
142265
143266 def addChild (self , child ) -> None :
267+ """
268+ Description to do
269+
270+ Args:
271+ child (TYPE): Description to do.
272+
273+ Returns:
274+ None: Description to do.
275+ """
276+
144277 self .children .append (child )
145278
146279 def create (self , _parent , layer ) -> QgsAttributeEditorContainer :
280+ """
281+ Description to do
282+
283+ Args:
284+ _parent (TYPE): Description to do.
285+ layer (TYPE): Description to do.
286+
287+ Returns:
288+ QgsAttributeEditorContainer: Description to do.
289+ """
290+
147291 container = QgsAttributeEditorContainer (self .name )
148292 container .setIsGroupBox (True )
149293 container .setColumnCount (self .columns )
0 commit comments