Subgroup: Attribute

Class: QgsAttributeEditorContainer

class qgis.core.QgsAttributeEditorContainer

Bases: qgis._core.QgsAttributeEditorElement

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.

Methods

addChildElement Add a child element to this container.
children Get a list of the children elements of this container
clear Clear all children from this container.
clone Creates a deep copy of this element.
columnCount Get the number of columns in this group
findElements Traverses the element tree to find any element of the specified type
isGroupBox Returns if this container is going to be rendered as a group box
name Return the name of this element
parent Get the parent of this element.
setColumnCount Set the number of columns in this group
setIsGroupBox Determines if this container is rendered as collapsible group box or tab in a tabwidget
setName Change the name of this container
setShowLabel Controls if this element should be labeled with a title (field, relation or groupname).
setVisibilityExpression 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.
showLabel Controls if this element should be labeled with a title (field, relation or groupname).
toDomElement Get the XML Dom element to save this element.
type The type of this element
visibilityExpression 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.

Attributes

AeTypeContainer
AeTypeField
AeTypeInvalid
AeTypeRelation
addChildElement(self, element: QgsAttributeEditorElement)

Add a child element to this container. This may be another container, a field or a relation.

Parameters:element – The element to add as child
children(self) → object

Get a list of the children elements of this container

Returns:A list of elements
clear(self)

Clear all children from this container.

clone(self, parent: QgsAttributeEditorElement) → QgsAttributeEditorElement

Creates a deep copy of this element. To be implemented by subclasses.

New in version 3.0.

columnCount(self) → int

Get the number of columns in this group

findElements(self, type: QgsAttributeEditorElement.AttributeEditorType) → List[QgsAttributeEditorElement]

Traverses the element tree to find any element of the specified type

Parameters:type – The type which should be searched
Returns:A list of elements of the type which has been searched for
isGroupBox(self) → bool

Returns if this container is going to be rendered as a group box

Returns:True if it will be a group box, false if it will be a tab
setColumnCount(self, columnCount: int)

Set the number of columns in this group

setIsGroupBox(self, isGroupBox: bool)

Determines if this container is rendered as collapsible group box or tab in a tabwidget

Parameters:isGroupBox – If true, this will be a group box
setName(self, name: str)

Change the name of this container

setVisibilityExpression(self, visibilityExpression: QgsOptionalExpression)

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.

New in version 3.0.

visibilityExpression(self) → QgsOptionalExpression

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.

New in version 3.0.