Class: QgsAttributeEditorContainer¶
A container for attribute editors, used to group them visually in the attribute form if it is set to the drag and drop designer.
Class Hierarchy¶
Base classes¶
An abstract base class for any elements of a drag and drop form. |
- class qgis.core.QgsAttributeEditorContainer[source]¶
Bases:
QgsAttributeEditorElement- __init__(name: str | None, parent: QgsAttributeEditorElement | None, backgroundColor: QColor | Qt.GlobalColor = QColor())
Creates a new attribute editor container
- Parameters:
name (Optional[str]) – The name to show as title
parent (Optional[QgsAttributeEditorElement]) – The parent. May be another container.
backgroundColor (Union[QColor, Qt.GlobalColor] = QColor()) – The optional background color of the container.
- __init__(a0: QgsAttributeEditorContainer)
- Parameters:
- virtual addChildElement(self, element: QgsAttributeEditorElement | None)[source]¶
Add a child element to this container. This may be another container, a field or a relation.
- Parameters:
element (Optional[QgsAttributeEditorElement]) – The element to add as child
- backgroundColor(self) QColor[source]¶
Returns the background color of the container.
See also
Added in version 3.8.
- Return type:
QColor
- children(self) List[QgsAttributeEditorElement]¶
Gets a list of the children elements of this container
- Return type:
- Returns:
A list of elements
- abstract clone(self, parent: QgsAttributeEditorElement | None) QgsAttributeEditorElement | None[source]¶
Creates a deep copy of this element. To be implemented by subclasses.
- Parameters:
parent (Optional[QgsAttributeEditorElement])
- Return type:
Optional[QgsAttributeEditorElement]
- collapsed(self) bool[source]¶
For group box containers returns
Trueif this group box is collapsed.- Return type:
bool
- Returns:
Trueif the group box is collapsed,Falseotherwise.
See also
See also
Added in version 3.26.
- virtual findElements(self, type: Qgis.AttributeEditorType) List[QgsAttributeEditorElement]¶
Traverses the element tree to find any element of the specified type
- Parameters:
type (Qgis.AttributeEditorType) – The type which should be searched
- Return type:
- Returns:
A list of elements of the type which has been searched for
- virtual isGroupBox(self) bool[source]¶
Returns if this container is going to be a group box
- Return type:
bool
- Returns:
Trueif it will be a group box,Falseif it will be a tab
Deprecated since version 3.40: Use
type()instead.
- setBackgroundColor(self, backgroundColor: QColor | Qt.GlobalColor)[source]¶
Sets the background color to
backgroundColor.See also
- Parameters:
backgroundColor (Union[QColor, Qt.GlobalColor])
- setCollapsed(self, collapsed: bool)[source]¶
For group box containers sets if this group box is
collapsed.See also
See also
Added in version 3.26.
- Parameters:
collapsed (bool)
- setColumnCount(self, columnCount: int)[source]¶
Set the number of columns in this group.
See also
- Parameters:
columnCount (int)
- virtual setIsGroupBox(self, isGroupBox: bool)[source]¶
Determines if this container is rendered as collapsible group box or tab in a tabwidget
- Parameters:
isGroupBox (bool) – If
True, this will be a group box
Deprecated since version 3.40: Use
setType()instead.
- setName(self, name: str | None)[source]¶
Change the name of this container.
- Parameters:
name (Optional[str])
- setType(self, type: Qgis.AttributeEditorContainerType)[source]¶
Sets the container type.
See also
Added in version 3.32.
- Parameters:
- setVisibilityExpression(self, visibilityExpression: QgsOptionalExpression)[source]¶
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.
- Parameters:
visibilityExpression (QgsOptionalExpression)
- type(self) Qgis.AttributeEditorContainerType[source]¶
Returns the container type.
See also
Added in version 3.32.
- Return type:
- visibilityExpression(self) QgsOptionalExpression[source]¶
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.
- Return type: