Class: QgsAttributeEditorElement¶
- class qgis.core.QgsAttributeEditorElement¶
Bases:
sip.wrapper
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.QgsAttributeEditorElement(type: QgsAttributeEditorElement.AttributeEditorType, name: str, parent:
QgsAttributeEditorElement
= None) Constructor- Parameters:
type – The type of the new element.
name –
parent –
QgsAttributeEditorElement(
QgsAttributeEditorElement
)Methods
Returns a clone of this element.
Constructs the editor element from the given element
Returns the name of this element
Gets the parent of this element.
Controls if this element should be labeled with a title (field, relation or groupname).
Controls if this element should be labeled with a title (field, relation or groupname).
Gets the XML Dom element to save this element.
The type of this element
Attributes
- AeTypeAction = 6¶
- AeTypeContainer = 0¶
- AeTypeField = 1¶
- AeTypeHtmlElement = 5¶
- AeTypeInvalid = 3¶
- AeTypeQmlElement = 4¶
- AeTypeRelation = 2¶
- class AttributeEditorType¶
Bases:
int
- clone(self, parent: QgsAttributeEditorElement) QgsAttributeEditorElement ¶
Returns a clone of this element. To be implemented by subclasses.
New in version 3.0.
- Parameters:
parent (QgsAttributeEditorElement) –
- Return type:
- create(element: QDomElement, layerId: str, fields: QgsFields, context: QgsReadWriteContext, parent: QgsAttributeEditorElement = None) QgsAttributeEditorElement ¶
Constructs the editor element from the given element
New in version 3.18.
- Parameters:
element (QDomElement) –
layerId (str) –
fields (QgsFields) –
context (QgsReadWriteContext) –
parent (
QgsAttributeEditorElement
= None) –
- Return type:
- name(self) str ¶
Returns the name of this element
- Return type:
str
- Returns:
The name for this element
- parent(self) QgsAttributeEditorElement ¶
Gets the parent of this element.
New in version 3.0.
- Return type:
- setShowLabel(self, showLabel: bool)¶
Controls if this element should be labeled with a title (field, relation or groupname).
New in version 2.18.
- Parameters:
showLabel (bool) –
- showLabel(self) bool ¶
Controls if this element should be labeled with a title (field, relation or groupname).
New in version 2.18.
- Return type:
bool
- toDomElement(self, doc: QDomDocument) QDomElement ¶
Gets the XML Dom element to save this element.
- Parameters:
doc (QDomDocument) – The QDomDocument which is used to create new XML elements
- Return type:
QDomElement
- Returns:
A DOM element to serialize this element
- type(self) QgsAttributeEditorElement.AttributeEditorType ¶
The type of this element
- Return type:
- Returns:
The type