QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
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. More...
#include <qgsattributeeditorelement.h>
Public Member Functions | |
QgsAttributeEditorContainer (const QString &name, QgsAttributeEditorElement *parent, const QColor &backgroundColor=QColor()) | |
Creates a new attribute editor container. More... | |
~QgsAttributeEditorContainer () override | |
virtual void | addChildElement (QgsAttributeEditorElement *element) |
Add a child element to this container. More... | |
QColor | backgroundColor () const |
backgroundColor More... | |
QList< QgsAttributeEditorElement * > | children () const |
Gets a list of the children elements of this container. More... | |
void | clear () |
Clear all children from this container. More... | |
QgsAttributeEditorElement * | clone (QgsAttributeEditorElement *parent) const override |
Creates a deep copy of this element. More... | |
int | columnCount () const |
Gets the number of columns in this group. More... | |
virtual QList< QgsAttributeEditorElement * > | findElements (AttributeEditorType type) const |
Traverses the element tree to find any element of the specified type. More... | |
virtual bool | isGroupBox () const |
Returns if this container is going to be rendered as a group box. More... | |
void | setBackgroundColor (const QColor &backgroundColor) |
Sets the background color to backgroundColor. More... | |
void | setColumnCount (int columnCount) |
Set the number of columns in this group. More... | |
virtual void | setIsGroupBox (bool isGroupBox) |
Determines if this container is rendered as collapsible group box or tab in a tabwidget. More... | |
void | setName (const QString &name) |
Change the name of this container. More... | |
void | setVisibilityExpression (const QgsOptionalExpression &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. More... | |
QgsOptionalExpression | visibilityExpression () const |
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. More... | |
Public Member Functions inherited from QgsAttributeEditorElement | |
QgsAttributeEditorElement (AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr) | |
Constructor. More... | |
virtual | ~QgsAttributeEditorElement ()=default |
QString | name () const |
Returns the name of this element. More... | |
QgsAttributeEditorElement * | parent () const |
Gets the parent of this element. More... | |
void | setShowLabel (bool showLabel) |
Controls if this element should be labeled with a title (field, relation or groupname). More... | |
bool | showLabel () const |
Controls if this element should be labeled with a title (field, relation or groupname). More... | |
QDomElement | toDomElement (QDomDocument &doc) const |
Gets the XML Dom element to save this element. More... | |
AttributeEditorType | type () const |
The type of this element. More... | |
Additional Inherited Members | |
Public Types inherited from QgsAttributeEditorElement | |
enum | AttributeEditorType { AeTypeContainer, AeTypeField, AeTypeRelation, AeTypeInvalid, AeTypeQmlElement, AeTypeHtmlElement } |
Protected Attributes inherited from QgsAttributeEditorElement | |
QString | mName |
QgsAttributeEditorElement * | mParent = nullptr |
bool | mShowLabel |
AttributeEditorType | mType |
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.
Definition at line 171 of file qgsattributeeditorelement.h.
|
inline |
Creates a new attribute editor container.
name | The name to show as title |
parent | The parent. May be another container. |
backgroundColor | The optional background color of the container. |
Definition at line 182 of file qgsattributeeditorelement.h.
|
override |
Definition at line 27 of file qgseditformconfig.cpp.
|
virtual |
Add a child element to this container.
This may be another container, a field or a relation.
element | The element to add as child |
Definition at line 20 of file qgsattributeeditorelement.cpp.
QColor QgsAttributeEditorContainer::backgroundColor | ( | ) | const |
backgroundColor
Definition at line 43 of file qgsattributeeditorelement.cpp.
|
inline |
Gets a list of the children elements of this container.
Definition at line 218 of file qgsattributeeditorelement.h.
void QgsAttributeEditorContainer::clear | ( | ) |
Clear all children from this container.
Definition at line 76 of file qgsattributeeditorelement.cpp.
|
overridevirtual |
Creates a deep copy of this element.
To be implemented by subclasses.
Implements QgsAttributeEditorElement.
Definition at line 737 of file qgseditformconfig.cpp.
int QgsAttributeEditorContainer::columnCount | ( | ) | const |
Gets the number of columns in this group.
Definition at line 727 of file qgseditformconfig.cpp.
|
virtual |
Traverses the element tree to find any element of the specified type.
type | The type which should be searched |
Definition at line 53 of file qgsattributeeditorelement.cpp.
|
inlinevirtual |
Returns if this container is going to be rendered as a group box.
true
if it will be a group box, false
if it will be a tab Definition at line 211 of file qgsattributeeditorelement.h.
void QgsAttributeEditorContainer::setBackgroundColor | ( | const QColor & | backgroundColor | ) |
Sets the background color to backgroundColor.
Definition at line 48 of file qgsattributeeditorelement.cpp.
void QgsAttributeEditorContainer::setColumnCount | ( | int | columnCount | ) |
Set the number of columns in this group.
Definition at line 732 of file qgseditformconfig.cpp.
|
inlinevirtual |
Determines if this container is rendered as collapsible group box or tab in a tabwidget.
isGroupBox | If true , this will be a group box |
Definition at line 204 of file qgsattributeeditorelement.h.
void QgsAttributeEditorContainer::setName | ( | const QString & | name | ) |
Change the name of this container.
Definition at line 25 of file qgsattributeeditorelement.cpp.
void QgsAttributeEditorContainer::setVisibilityExpression | ( | const QgsOptionalExpression & | 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.
Definition at line 35 of file qgsattributeeditorelement.cpp.
QgsOptionalExpression QgsAttributeEditorContainer::visibilityExpression | ( | ) | const |
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.
Definition at line 30 of file qgsattributeeditorelement.cpp.