QGIS API Documentation  2.99.0-Master (6a61179)
Public Member Functions | List of all members
QgsAttributeEditorContainer Class Reference

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>

Inheritance diagram for QgsAttributeEditorContainer:
Inheritance graph
[legend]

Public Member Functions

 QgsAttributeEditorContainer (const QString &name, QgsAttributeEditorElement *parent)
 Creates a new attribute editor container. More...
 
virtual ~QgsAttributeEditorContainer ()
 Destructor. More...
 
virtual void addChildElement (QgsAttributeEditorElement *element)
 Add a child element to this container. More...
 
QList< QgsAttributeEditorElement * > children () const
 Get a list of the children elements of this container. More...
 
void clear ()
 Clear all children from this container. More...
 
virtual QgsAttributeEditorElementclone (QgsAttributeEditorElement *parent) const override
 Creates a deep copy of this element. More...
 
int columnCount () const
 Get 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 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 ()
 Destructor. More...
 
QString name () const
 Return the name of this element. More...
 
QgsAttributeEditorElementparent () const
 Get 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
 Get 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 }
 
- Protected Attributes inherited from QgsAttributeEditorElement
QString mName
 
QgsAttributeEditorElementmParent
 
bool mShowLabel
 
AttributeEditorType mType
 

Detailed Description

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 142 of file qgsattributeeditorelement.h.

Constructor & Destructor Documentation

§ QgsAttributeEditorContainer()

QgsAttributeEditorContainer::QgsAttributeEditorContainer ( const QString &  name,
QgsAttributeEditorElement parent 
)
inline

Creates a new attribute editor container.

Parameters
nameThe name to show as title
parentThe parent. May be another container.

Definition at line 152 of file qgsattributeeditorelement.h.

§ ~QgsAttributeEditorContainer()

QgsAttributeEditorContainer::~QgsAttributeEditorContainer ( )
virtual

Destructor.

Definition at line 22 of file qgseditformconfig.cpp.

Member Function Documentation

§ addChildElement()

void QgsAttributeEditorContainer::addChildElement ( QgsAttributeEditorElement element)
virtual

Add a child element to this container.

This may be another container, a field or a relation.

Parameters
elementThe element to add as child

Definition at line 19 of file qgsattributeeditorelement.cpp.

§ children()

QList<QgsAttributeEditorElement*> QgsAttributeEditorContainer::children ( ) const
inline

Get a list of the children elements of this container.

Returns
A list of elements

Definition at line 187 of file qgsattributeeditorelement.h.

§ clear()

void QgsAttributeEditorContainer::clear ( )

Clear all children from this container.

Definition at line 64 of file qgsattributeeditorelement.cpp.

§ clone()

QgsAttributeEditorElement * QgsAttributeEditorContainer::clone ( QgsAttributeEditorElement parent) const
overridevirtual

Creates a deep copy of this element.

To be implemented by subclasses.

Note
Added in QGIS 3.0

Implements QgsAttributeEditorElement.

Definition at line 577 of file qgseditformconfig.cpp.

§ columnCount()

int QgsAttributeEditorContainer::columnCount ( ) const

Get the number of columns in this group.

Definition at line 567 of file qgseditformconfig.cpp.

§ findElements()

QList< QgsAttributeEditorElement * > QgsAttributeEditorContainer::findElements ( QgsAttributeEditorElement::AttributeEditorType  type) const
virtual

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

Parameters
typeThe type which should be searched
Returns
A list of elements of the type which has been searched for

Definition at line 42 of file qgsattributeeditorelement.cpp.

§ isGroupBox()

virtual bool QgsAttributeEditorContainer::isGroupBox ( ) const
inlinevirtual

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

Definition at line 180 of file qgsattributeeditorelement.h.

§ setColumnCount()

void QgsAttributeEditorContainer::setColumnCount ( int  columnCount)

Set the number of columns in this group.

Definition at line 572 of file qgseditformconfig.cpp.

§ setIsGroupBox()

virtual void QgsAttributeEditorContainer::setIsGroupBox ( bool  isGroupBox)
inlinevirtual

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

Parameters
isGroupBoxIf true, this will be a group box

Definition at line 173 of file qgsattributeeditorelement.h.

§ setName()

void QgsAttributeEditorContainer::setName ( const QString &  name)

Change the name of this container.

Definition at line 24 of file qgsattributeeditorelement.cpp.

§ setVisibilityExpression()

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.

Note
Added in QGIS 3.0

Definition at line 34 of file qgsattributeeditorelement.cpp.

§ visibilityExpression()

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.

Note
Added in QGIS 3.0

Definition at line 29 of file qgsattributeeditorelement.cpp.


The documentation for this class was generated from the following files: