QGIS API Documentation  2.99.0-Master (c558d51)
Public Types | Public Member Functions | Protected Attributes | List of all members
QgsAttributeEditorElement Class Referenceabstract

This is an abstract base class for any elements of a drag and drop form. More...

#include <qgsattributeeditorelement.h>

Inheritance diagram for QgsAttributeEditorElement:
Inheritance graph
[legend]

Public Types

enum  AttributeEditorType { AeTypeContainer, AeTypeField, AeTypeRelation, AeTypeInvalid }
 

Public Member Functions

 QgsAttributeEditorElement (AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
 Constructor. More...
 
virtual ~QgsAttributeEditorElement ()
 Destructor. More...
 
virtual QgsAttributeEditorElementclone (QgsAttributeEditorElement *parent) const =0
 Returns a clone of this element. 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...
 

Protected Attributes

QString mName
 
QgsAttributeEditorElementmParent
 
bool mShowLabel
 
AttributeEditorType mType
 

Detailed Description

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 ca 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.

Definition at line 34 of file qgsattributeeditorelement.h.

Member Enumeration Documentation

Enumerator
AeTypeContainer 

A container.

AeTypeField 

A field.

AeTypeRelation 

A relation.

AeTypeInvalid 

Invalid.

Definition at line 37 of file qgsattributeeditorelement.h.

Constructor & Destructor Documentation

QgsAttributeEditorElement::QgsAttributeEditorElement ( AttributeEditorType  type,
const QString &  name,
QgsAttributeEditorElement parent = nullptr 
)
inline

Constructor.

Parameters
typeThe type of the new element. Should never
name
parent

Definition at line 52 of file qgsattributeeditorelement.h.

virtual QgsAttributeEditorElement::~QgsAttributeEditorElement ( )
inlinevirtual

Destructor.

Definition at line 60 of file qgsattributeeditorelement.h.

Member Function Documentation

virtual QgsAttributeEditorElement* QgsAttributeEditorElement::clone ( QgsAttributeEditorElement parent) const
pure virtual

Returns a clone of this element.

To be implemented by subclasses.

Note
Added in QGIS 3.0

Implemented in QgsAttributeEditorRelation, QgsAttributeEditorField, and QgsAttributeEditorContainer.

QString QgsAttributeEditorElement::name ( ) const
inline

Return the name of this element.

Returns
The name for this element

Definition at line 67 of file qgsattributeeditorelement.h.

QgsAttributeEditorElement* QgsAttributeEditorElement::parent ( ) const
inline

Get the parent of this element.

Note
Added in QGIS 3.0

Definition at line 81 of file qgsattributeeditorelement.h.

void QgsAttributeEditorElement::setShowLabel ( bool  showLabel)

Controls if this element should be labeled with a title (field, relation or groupname).

Note
Added in QGIS 2.18

Definition at line 117 of file qgsattributeeditorelement.cpp.

bool QgsAttributeEditorElement::showLabel ( ) const

Controls if this element should be labeled with a title (field, relation or groupname).

Note
Added in QGIS 2.18

Definition at line 112 of file qgsattributeeditorelement.cpp.

QDomElement QgsAttributeEditorElement::toDomElement ( QDomDocument &  doc) const

Get the XML Dom element to save this element.

Parameters
docThe QDomDocument which is used to create new XML elements
Returns
A DOM element to serialize this element

Definition at line 102 of file qgsattributeeditorelement.cpp.

AttributeEditorType QgsAttributeEditorElement::type ( ) const
inline

The type of this element.

Returns
The type

Definition at line 74 of file qgsattributeeditorelement.h.

Member Data Documentation

QString QgsAttributeEditorElement::mName
protected

Definition at line 115 of file qgsattributeeditorelement.h.

QgsAttributeEditorElement* QgsAttributeEditorElement::mParent
protected

Definition at line 116 of file qgsattributeeditorelement.h.

bool QgsAttributeEditorElement::mShowLabel
protected

Definition at line 117 of file qgsattributeeditorelement.h.

AttributeEditorType QgsAttributeEditorElement::mType
protected

Definition at line 114 of file qgsattributeeditorelement.h.


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