QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static 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]

Classes

struct  LabelStyle
 The TabStyle struct defines color and font overrides for form fields, tabs and groups labels. More...
 

Public Member Functions

 QgsAttributeEditorElement (Qgis::AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
 Constructor.
 
virtual ~QgsAttributeEditorElement ()=default
 
virtual QgsAttributeEditorElementclone (QgsAttributeEditorElement *parent) const =0
 Returns a clone of this element.
 
int horizontalStretch () const
 Returns the horizontal stretch factor for the element.
 
LabelStyle labelStyle () const
 Returns the label style.
 
QString name () const
 Returns the name of this element.
 
QgsAttributeEditorElementparent () const
 Gets the parent of this element.
 
void setHorizontalStretch (int stretch)
 Sets the horizontal stretch factor for the element.
 
void setLabelStyle (const LabelStyle &labelStyle)
 Sets the labelStyle.
 
void setShowLabel (bool showLabel)
 Controls if this element should be labeled with a title (field, relation or groupname).
 
void setVerticalStretch (int stretch)
 Sets the vertical stretch factor for the element.
 
bool showLabel () const
 Controls if this element should be labeled with a title (field, relation or groupname).
 
QDomElement toDomElement (QDomDocument &doc) const
 Gets the XML Dom element to save this element.
 
Qgis::AttributeEditorType type () const
 The type of this element.
 
int verticalStretch () const
 Returns the vertical stretch factor for the element.
 

Static Public Member Functions

static QgsAttributeEditorElementcreate (const QDomElement &element, const QString &layerId, const QgsFields &fields, const QgsReadWriteContext &context, QgsAttributeEditorElement *parent=nullptr)
 Constructs the editor element from the given element.
 

Protected Attributes

int mHorizontalStretch = 0
 
LabelStyle mLabelStyle
 
QString mName
 
QgsAttributeEditorElementmParent = nullptr
 
bool mShowLabel = true
 
Qgis::AttributeEditorType mType = Qgis::AttributeEditorType::Invalid
 
int mVerticalStretch = 0
 

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

Constructor & Destructor Documentation

◆ QgsAttributeEditorElement()

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

Constructor.

Parameters
typeThe type of the new element.
name
parent

Definition at line 114 of file qgsattributeeditorelement.h.

◆ ~QgsAttributeEditorElement()

virtual QgsAttributeEditorElement::~QgsAttributeEditorElement ( )
virtualdefault

Member Function Documentation

◆ clone()

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

◆ create()

QgsAttributeEditorElement * QgsAttributeEditorElement::create ( const QDomElement &  element,
const QString &  layerId,
const QgsFields fields,
const QgsReadWriteContext context,
QgsAttributeEditorElement parent = nullptr 
)
static

Constructs the editor element from the given element.

Since
QGIS 3.18

Definition at line 62 of file qgsattributeeditorelement.cpp.

◆ horizontalStretch()

int QgsAttributeEditorElement::horizontalStretch ( ) const
inline

Returns the horizontal stretch factor for the element.

See also
setHorizontalStretch()
verticalStretch()
Since
QGIS 3.32

Definition at line 187 of file qgsattributeeditorelement.h.

◆ labelStyle()

QgsAttributeEditorElement::LabelStyle QgsAttributeEditorElement::labelStyle ( ) const

Returns the label style.

See also
setLabelStyle()
Since
QGIS 3.26

Definition at line 52 of file qgsattributeeditorelement.cpp.

◆ name()

QString QgsAttributeEditorElement::name ( ) const
inline

Returns the name of this element.

Returns
The name for this element

Definition at line 134 of file qgsattributeeditorelement.h.

◆ parent()

QgsAttributeEditorElement * QgsAttributeEditorElement::parent ( ) const
inline

Gets the parent of this element.

Since
QGIS 3.0

Definition at line 148 of file qgsattributeeditorelement.h.

◆ setHorizontalStretch()

void QgsAttributeEditorElement::setHorizontalStretch ( int  stretch)
inline

Sets the horizontal stretch factor for the element.

See also
horizontalStretch()
setVerticalStretch()
Since
QGIS 3.32

Definition at line 197 of file qgsattributeeditorelement.h.

◆ setLabelStyle()

void QgsAttributeEditorElement::setLabelStyle ( const LabelStyle labelStyle)

Sets the labelStyle.

See also
labelStyle()
Since
QGIS 3.26

Definition at line 57 of file qgsattributeeditorelement.cpp.

◆ setShowLabel()

void QgsAttributeEditorElement::setShowLabel ( bool  showLabel)

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

Since
QGIS 2.18

Definition at line 47 of file qgsattributeeditorelement.cpp.

◆ setVerticalStretch()

void QgsAttributeEditorElement::setVerticalStretch ( int  stretch)
inline

Sets the vertical stretch factor for the element.

See also
verticalStretch()
setHorizontalStretch()
Since
QGIS 3.32

Definition at line 217 of file qgsattributeeditorelement.h.

◆ showLabel()

bool QgsAttributeEditorElement::showLabel ( ) const

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

Since
QGIS 2.18

Definition at line 42 of file qgsattributeeditorelement.cpp.

◆ toDomElement()

QDomElement QgsAttributeEditorElement::toDomElement ( QDomDocument &  doc) const

Gets 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 30 of file qgsattributeeditorelement.cpp.

◆ type()

Qgis::AttributeEditorType QgsAttributeEditorElement::type ( ) const
inline

The type of this element.

Returns
The type

Definition at line 141 of file qgsattributeeditorelement.h.

◆ verticalStretch()

int QgsAttributeEditorElement::verticalStretch ( ) const
inline

Returns the vertical stretch factor for the element.

See also
setVerticalStretch()
horizontalStretch()
Since
QGIS 3.32

Definition at line 207 of file qgsattributeeditorelement.h.

Member Data Documentation

◆ mHorizontalStretch

int QgsAttributeEditorElement::mHorizontalStretch = 0
protected

Definition at line 240 of file qgsattributeeditorelement.h.

◆ mLabelStyle

LabelStyle QgsAttributeEditorElement::mLabelStyle
protected

Definition at line 242 of file qgsattributeeditorelement.h.

◆ mName

QString QgsAttributeEditorElement::mName
protected

Definition at line 237 of file qgsattributeeditorelement.h.

◆ mParent

QgsAttributeEditorElement* QgsAttributeEditorElement::mParent = nullptr
protected

Definition at line 238 of file qgsattributeeditorelement.h.

◆ mShowLabel

bool QgsAttributeEditorElement::mShowLabel = true
protected

Definition at line 239 of file qgsattributeeditorelement.h.

◆ mType

Qgis::AttributeEditorType QgsAttributeEditorElement::mType = Qgis::AttributeEditorType::Invalid
protected

Definition at line 236 of file qgsattributeeditorelement.h.

◆ mVerticalStretch

int QgsAttributeEditorElement::mVerticalStretch = 0
protected

Definition at line 241 of file qgsattributeeditorelement.h.


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